In 2004, Gay marriage was a huge issue in several states, and is thought to have pushed Bush over the edge in Ohio. But this is a one-time issue: there are only so many times you can pass a constitutional referendum on the same subject. This issue was huge in swing states and may have pushed Gay support for Kerry to higher levels.
But in 2008, there were still some similar amendments, especially in populous Florida and California. Obama's support for Gay marriage in California was notably luke-warm, he basically said that he thought that marriage was between a man and a woman but that the constitution should not be amended to support his belief.
In the primary campaign, Obama gave a big speech to a black congregation in Atlanta where he specifically tied rights for gays and lesbians to the struggle for racial justice saying
And yet, if we are honest with ourselves, we must admit that none of our hands are entirely clean. If we're honest with ourselves, we'll acknowledge that our own community has not always been true to King's vision of a beloved community.
We have scorned our gay brothers and sisters instead of embracing them. The scourge of anti-Semitism has, at times, revealed itself in our community. For too long, some of us have seen immigrants as competitors for jobs instead of companions in the fight for opportunity.
But he made no such effort in the national campaign. Had he pushed harder for black support for marriage equality in California, it might not have foundered.