The problem is when they are clearly doing it just to pander to their audience. I don't have a problem with a candidate who was previously pro-choice changing his or her mind to become pro-life based on some sort of revelation they had, or some other issue...whatever. (Romney has actually changed his mind about this specific issue) If it's based on a shift in your philosophical outlook on life, fine. People change.
What I object to are guys like Arlen Specter, who have been the member of one party for so long, and then decide to change parties suddenly because they are facing a challenge in their party's primary for an election. If your change in mind is based on nothing more than political expediency, fuck off.
If you campaign on one thing, knowing that it's popular, all the while knowing that as soon as you get elected you are going to to the opposite, (ie, believing the opposite of what you are actually campaigning on just to get more votes) fuck off.