In the last month, three courts in three different states have struck down state laws banning same-sex marriage. The courts, in New Mexico and Utah in late December and again in Oklahoma earlier this week, agreed that the bans violate constitutional principles of equality because the laws discriminate based on sexual orientation.

But the courts disagreed about a different question: whether the state anti-gay marriage laws discriminate based on sex. The New Mexico Supreme Court and the federal court in Oklahoma both ruled that banning same-sex marriage does not discriminate based on sex, while the federal court in Utah held that it did.

“Wait a second,” you’re probably saying. “Discrimination based on sex? The laws aren’t about sex. They’re about sexual orientation. After all, under the laws, gays and lesbians can’t marry, so New Mexico and Oklahoma were correct, while Utah was wrong.” But as it turns out, the exact opposite is true.

Consider a typical law that bans same-sex marriage, like Oklahoma’s constitutional amendment struck down Tuesday. It states, “Marriage in this state shall consist only of the union of one man and one woman.” Under this law, can gays and lesbians marry? Absolutely. In fact, right now, gays and lesbians can get married in every single state in this country. The problem, of course, is that gays and lesbians cannot marry the person they want to marry. They are perfectly free to marry anyone of the opposite sex, but not someone of the same sex.

And this is very clearly sex discrimination. None of the state bans on same-sex marriage contain any language about sexual orientation. Rather, the language is entirely about sex—“one man and one woman.” A simple hypothetical makes this entirely clear. Imagine three people—Nancy, Bill, and Tom. Tom, lucky guy that he is, is the object of both Nancy’s and Bill’s affection. Based on the language of the law, which of Nancy or Bill can marry Tom? Answering that question requires no knowledge of Nancy’s or Bill’s sexual orientation. All you need to know is Nancy’s and Bill’s sex.

Knowing that makes the answer obvious. Nancy, a woman, can marry Tom, but Bill, a man, cannot. Put differently, Nancy can do something (marry Tom) that Bill cannot, simply because Nancy is a woman and Bill is a man. In the language of anti-discrimination law, a man is disabled from doing something a woman can do, solely based on his sex. That is sex discrimination.

This simple logic and text-based argument that bans on same-sex marriage constitute sex discrimination is not new, as legal scholars such as Andrew Koppelman and Sylvia Law have been making and defending this argument for decades. The Hawaii Supreme Court based its 1993 decision about same-sex marriage on this argument as well. But ever since Hawaii when that argument has been aired in the courts, for the most part the courts have rejected it and, in the process, gotten it entirely wrong.

The New Mexico and Oklahoma decisions have represented the norm on this topic, while the Utah decision—finding that there is in fact sex discrimination at play here—is the outlier. The rationale that most courts have adopted in rejecting the sex discrimination argument is that bans on same-sex marriage aren’t sex discrimination because they apply to both sexes equally—gay men cannot marry one another just like lesbian women cannot marry one another. Because, the argument goes, the laws treat men and women equally in this manner, this is not sex discrimination.

The logic of this argument, though superficially appealing, has its roots in the Jim Crow era. In the 1883 case of Pace v. Alabama, Alabama defended a law that increased the penalty for two people cohabitating if they were “any white person and any negro.” The Supreme Court found no constitutional violation because the law “applies the same to both offenders, the white and the black.” In other words, said the Court, because both white people and black people were equally disabled from doing the same thing—cohabitating with the other—the law did not offend any principles of equality.

This logic was flatly rejected by the Supreme Court in the 1960s. First, in 1964 in McLaughlin v. Florida, the court rejected Florida’s attempt to use that same logic to defend a law that prohibited any unmarried “negro man and white woman, or any white man and negro woman” from spending the night together. The court said, very clearly, that equality analysis “does not end with a showing of equal application among the members of the class defined by the legislation.”

Three years later, in the famous case of Loving v. Virginia, the court said it again. Virginia defended its ban on interracial marriage by claiming that the laws “apply equally to whites and Negroes in the sense that members of each race are punished to the same degree.” The court, citing McLaughlin, once again rejected this argument. What matters, the court said, is that the classification in the law is about race.

Having been so clearly rejected by the court in the 1960s as a remnant of Jim Crow (and rejected yet again in 2005 in Johnson v. California), why are courts today so readily adopting this “equal application” argument in the context of same-sex marriage? First, the courts may believe that race and sex/sexual orientation are different. While that’s certainly true as a matter of how closely courts scrutinize laws (laws that categorize based on race are scrutinized more deeply and more often overturned), that is incorrect in determining the logic of when a law classifies and on what basis. The court has consistently applied the same principles in determining this preliminary question, regardless of whether the context is race or sex.

Second, the courts may feel that this argument uses dishonest wordplay to transform sexual-orientation discrimination into sex discrimination. But characterizing opposition to same-sex marriage as sex discrimination is actually anything but dishonest wordplay. The argument gets at a deep understanding that homophobia is, in part, a form of gender stereotyping and oppression. Archaic conceptions of the role of men and women and their relationships underlie homophobia. Particularly in the context of marriage, assumptions that a woman needs a man to exist in the world (and a man needs a woman to dominate) are deeply rooted in American conceptions of marriage.

Third, the courts may think that the argument doesn’t capture the full extent of homophobia. This is certainly true, but this argument is not one that claims to capture every aspect of the discrimination at issue, nor one that claims to foreclose an argument based on sexual-orientation discrimination. Basic constitutional law says that even though the law’s language does not classify based on sexual orientation, it still has the purpose and effect of discriminating based on sexual orientation, which together is good enough to trigger scrutiny. The two arguments can coexist quite easily.

With none of the rationales against the sex-discrimination argument holding water, courts should be much more willing than they are to adopt this argument. Laws that prohibit same-sex marriage are a form of sex discrimination and sexual-orientation discrimination. Courts should recognize them as such.

The sex-discrimination argument is important for several reasons. It captures a distinct way that bans on same-sex marriage are pernicious—they perpetuate traditional gender roles, particularly within the institution of marriage. But it does more than that. It also puts bans on same-sex marriage in the context of a well-established body of constitutional law. Sex discrimination has been subject to a heightened form of scrutiny for four decades now, whereas sexual-orientation discrimination has yet to be given any heightened form of scrutiny. Understanding how same-sex marriage bans constitute sex discrimination helps in the quest to strike them down.

More broadly, though, finding that these bans are sex discrimination would help in other areas. Marriage equality does not solve all problems with respect to sexual orientation. Most states and the federal government do not bar, for instance, discrimination in employment, housing, or education based on sexual orientation. However, already existing laws do ban sex discrimination in these areas. If same-sex marriage bans are recognized as a form of sex discrimination, then so would firing someone because he’s gay (a woman loving a man wouldn’t have been fired) and refusing housing because she’s lesbian (a man loving a woman wouldn’t have been denied housing). In other words, many protections already written into the law could be extended to cover gays and lesbians with no new legislation needed.

Same-sex marriage bans are unconstitutional for many reasons. Courts need to come to grips with the fact that one of them is that they are a form of sex discrimination.

Correction, Jan. 18, 2014: Due to a photo provider error, the caption on the photo in this article misstated when the photo was taken and when the Defense of Marriage Act was struck down. It was in 2013, not 2012.