One justification for disallowing bans on same-sex marriage is that it's seen as discrimination to prevent same-sex couples from marrying. [In this post I'm not considering under what circumstances discrimination is wrong and when it's perfectly ok. The moral issue isn't my interest here. I'm just looking at whether it's discrimination, leaving aside the moral issue of whether such discrimination is ok. It's ok to discriminate against black people when casting a part in a play for a character that was written as a white racist. But it's still discrimination, just a perfectly legitimate kind. I'm interested in the legal implications here, not the moral ones.]
Whether a practice or act counts as discrimination depends on some assumptions. Two key issues are (a) who is being discriminated against and (b) on what basis.
Consider Loving v. Virginia, the Supreme Court case that overturned bans on interracial marriage. The Supreme Court ruled that the Equal Protection clause of the 14th Amendment prevents states from treating individuals of different races differently when it comes to who they can marry. If a man is black, he couldn't marry a white woman in Virginia, but if he'd been white then he could have. That's discrimination against individuals along race lines.
Restricting marriage to same-sex couples isn't quite parallel. It doesn't discriminate against individuals according to sexual orientation. A gay man has the same rights as a straight man. He can marry an unmarried woman who is of age or who otherwise satisfies the requirements for marriage (parental consent or whatever). Both can marry women, and neither can marry men. Similarly, a lesbian has the same rights as a heterosexual woman. Both can marry men, and neither can marry women. That's not discrimination according to sexual orientation, since people of both sexual orientations (holding sex constant) have exactly the same restrictions. The law is equally applied to gays and straights.
But it is discrimination against couples. Same-sex couples are not allowed something that opposite-sex couples are allowed. Does a couple have the kind of legal status to serve as a party in this kind of legal question? My suspicion is that it would be a major innovation in our legal system to treat a couple as a legal entity. I'm not sure that's the best strategy for same-sex couples to try if they want to make headway on this issue, but it is the easiest way to end up with a discrimination claim on the basis of sexual orientation.
I've long thought that the most promising case that bans on same-sex marriage are discrimination is to ignore sexual orientation entirely and to focus on a different basis of discrimination. Men are being discriminated against on the basis of their sex by not being allowed to marry people women are allowed to marry, and women are being discriminated against on the basis of their sex by not being allowed to marry people men can marry. If you ignore sexual orientation, as many social conservatives want to do, then this complaint gets a footing. Of course you have to think any discrimination on the basis of sex is wrong or explain why this particular one is if others aren't, which puts you back to square one if you want to draw a negative moral conclusion, but I'm ignoring that in this post.