According to information released by The Windy City Times, Obama was for same-sex marriage before he was against it (or, you know, favored "civil unions"- same damn thing). I think it's shitty, but I'm not exactly shocked.
People keep forgetting that he is in fact a politician, a sector of the population that tends to change their opinions based on what is going to get them elected. Part of what got him elected was convincing people in the middle that he was not a scary radical, with a "but really, you totally know I'm one of you" wink and nod to progressives. He's a blank enough slate that people feel comfortable ascribing their own moral code and opinions to him, without him ever having to say a word about it.
The way I look at it is this- if he actually does anything awesome, like support gay marriage, or give the funding back to overseas womens health clinics who provide abortions and birth control... then great. If he doesn't, I won't be shocked. Dude is, after all, a politician.