When the president says to support gay marriage i.e. gay rights, then said it is a state issue, this is what he meant.
For one, since the president cannot
unilaterally federalize gay marriage, there's no cost in saying it
would be a mistake to do so. Of course trying to do something that a President don't have the power to do is a mistake.
In other words, The president can certainly express his opinion that Congress shouldn't
federalize gay marriage. It's just his opinion, and he has no power
over Congress anyways.
"He's saying it would be best for states to create gay marriage, so the Supreme Court doesn't have to.
In other words, it would be a mistake for the states to make it a national issue."
Obama on gay marriage: The fine print : SCOTUSblog