No doubt he thinks he's pandering to his base with this announcement, but, the fact is, Same sex marriage legislation has been soundly defeated in every state where the matter was voted on by the voters. The only time it has been legalized was when the Constitutional voting process has been bypassed by the courts or by politicians who mistakenly believe the majority of their constituents actually want same sex marriage to be legal.
While some polls would seem to indicate the majority of Americans support same sex marriage, when the legislation comes up for a vote by the voters, it becomes clear they don't. Obama may indeed garner some support from the homosexuals and their supporters, but they are still a minority in this country, and most of them probably voted for him in the last election, anyway. Many of the independents and more Conservative Democrats who voted for him in 2008 could well drop their support for him solely because of this issue.
I don't believe his announced support of gay marriage is going to make a significant difference.
Additionally, the recent Democratic primaries would seem to indicate Obama has lost a lot of support even among the Democrats. In West Virginia's Democratic primary, an imprisoned felon in Texas took 41% of the Democratic votes away from Obama, carrying 10 counties.
All of this is good news for Republicans, but the election is still far off. There is still plenty of time for Obama's campaign operatives to dig up dirt on Romney, and if they can't find anything serious enough to sully him, they will make something up.
But, he has definitely blundered.