Looked at from another angle, it's actually quite democratic for a candidate for public office to shift his or her platform away from their personal beliefs and towards the beliefs of those they're attempting to represent.
But all he ended up representing was incoherent and incompatible policy preferences. I might agree that represents public opinion well, but it's nothing to be proud of.
At the time he was elected in 2008, a majority of Americans did not favor same-sex marriage.
At the time he changed his public stance, a majority of Americans favored same-sex marriage.
Seems coherent.
Obama's position was cowardly, but pretty much every knowledgeable Democrat and Republican believed and knew that he was just cynically posturing. He was a supporter of gay marriage in 1994, for Christ's sake. How many social liberals went through the past two decades and became less supportive of gay marriage? Only to switch their mind three years later?
Trust me, I'd be the first to point out that there's a whole lot to criticize Obama for in all of this. But believing he's a homophobe instead of a cynical liar is a bridge too far.