There's nothing wrong with changing your positions on things. However, when your positions change to pander to the electorate, that's when there's an issue. However, most of the blame lies with the electorate for claiming they want principled politicians, but really voting for those who say what they want to hear.
Take the Dem primary in 2008. Obama was against gay marriage, although he had made previous statements as a state senator in favor of it. Do you really think he was against it, or do you think he wanted the nomination? Which candidates were for it in the primary? Kucinich and Gravel, and look how far they got.