The first part might very well be from Obama the constitutional lawyer, meaning that it believes that the federal government has no place on defining what a marriage is and is not.
And the 2nd part might very well be from Obama himself, believing that "marriage" especially in the "traditional/religious" sense is a bond between a Man and a Woman doesn't mean you object to gay men, women, and transsexuals from being "married" in the legal sense of the way.
The Administration supported the fact that states are not allowed to ban gay marriage that in a sense actually matches what both "Obama's" said previously. And as long as gay couples can receive the same legal protection and benefits of any other "married" couple through any means I myself consider them to be equal in the eyes of the law and that anything beyond that is a fight for symbolism and semantics which while I do not object too I also do not actively support or take part in.