It absolutely matters. If a politician is just paying lip-service to a principle, he's definitely not going to fight for it. He's just going to do what he wants to do, and try to give the appearance of caring about the issue.
The person who actually believes what he espouses will actually work for that goal.
Unfortunately, the vast majority of politicians are the former rather than the latter, hence the popular perjorative "RINO". Maybe there's a similar thing on the Democrat side, but I can't think of one right now.