It will be said that this was a shameful pandering in an election year to the liberal base and perhaps an attempt to shift the focus away from the economy if even for a minute.
I'd say... Eh, not shameful, but certainly pragmatic. I think it's pretty clear he's supported it all along, but pissing off half your constituency is not something to be done lightly - especially in an election year.
On strategic terms alone, I think it was the right thing to hedge in '08, and NOT to hedge in '12. The base needed to be reminded that the guy is actually with us. This does that nicely - and all cynicism aside, this is an historical moment. The POTUS is for same sex marriage. Whatever else you want to say, it took courage to take this stand so definitively. The safe course would probably have been to keep saying his opinions were 'forming' until after Nov.
This is a bit of a gamble, because it gives voters a binary choice and the vote in NC this week clearly reminds us that there are sadly many bigots in this country who are zeroes rather than ones.
The scariest thing for me - if it's close, I think the Republicans win, because they are better at cheating and lawyering up that Democrats are. So they couldn't cheat in '08 because it wasn't close. They did successfully cheat in '00 and '04. No question in my mind that Gore and Kerry won those elections in the traditional sense - but in today's world part of the definition of 'winning' is being better at cheating or stopping cheating, so they didn't really win.