What happened? Harry Truman was fond of quoting Mark Twain: "When in doubt, do right. This will gratify some people and astonish the rest." Now and then, politicians have a "goddammit" moment. Obama's position had clearly shifted on the issue (who was he kidding with his talk of having "evolved" but being unwilling to make news?), and there was never going to be a better time to make the switch than now--at least not while he is certain to be a non-lame-duck president.
So Obama decided it's worth a roll of the dice to make history. Which is what he has done.
As of his announcement, favoring gay marriage is now fully, indisputably, and permanently a mainstream political position. All hint of weirdness or stigma is gone. It is also now the stated position of one of the two major political parties (only 16 years after President Bill Clinton, a Democrat, signed the anti-gay-marriage Defense of Marriage Act). Precisely because the issue is unlikely to decide the election this year, November's result will not revoke the issue's promotion in status even if Obama loses. Though gay couples have not achieved full legal equality, gay marriage, as an issue, has achieved full political equality. That is a landmark in the ongoing marriage debate.
The courts, as Obama, the former law professor, must be well aware, will take notice. Two big gay-rights cases--one challenging California's revocation of gay marriage, the other challenging the Defense of Marriage Act--are on their way toward the Supreme Court. With his switch from ambivalence to advocacy, Obama is sending a signal to the courts that the country is ready for gay marriage, giving them more cover to uphold it. Courts may not go by poll results, but they do like to stay within the mainstream. And Obama has just moved it.