I mostly meant within the context of the current law and the historical understanding that marriage was only between a man and a woman when the 14th amendment was added. In my opinion, the constitution, as it currently stands, doesn't consider prohibiting same-sex marriage to be gender-based discrimination.
Seems to me that the question of whether denying same-sex marriage is sex discrimination lies outside of law, and the law's purpose is simply to discuss which forms of discrimination are legal. I would say that at the time the 14th Amendment was written, it would have assumed that sex discrimination in the context of who can get married was allowed, not that it didn't consider it to be discrimination in the first place. But that's really just splitting hairs.
I think the important bits are: the 14th Amendment wouldn't have been considered to allow this when it was written, but now it is.