On Wednesday, the Department of Justice filed an amicus brief in the 2nd U.S. Circuit Court of Appeals arguing that Title VII of the Civil Rights Act of 1964 does not prohibit discrimination against gay and bisexual employees. The DOJ’s brief was not solicited by the court or any party to the case. Rather, in an unusual move, the Trump administration elected to weigh in with an aggressively anti-gay stance, arguing that gay Americans have no protection against workplace discrimination under federal law. Its decision is unsurprising in light of Attorney General Jeff Sessions’ vigorous opposition to LGBTQ rights.

Title VII does not explicitly outlaw sexual orientation discrimination in employment. However, it does forbid “discrimination … because of sex.” which the Equal Employment Opportunity Commission interprets to encompass anti-gay discrimination. For at least 15 years, many federal courts have agreed, and in April, the 7th U.S. Circuit Court of Appeals ruled that Title VII does, indeed, protect gay employees. Both the 7th Circuit and the EEOC relied on three theories of sex discrimination:

1. “But-for” sex discrimination

This theory holds that anti-gay discrimination qualifies as sex discrimination because, but for the gay person’s sex, she would not be discriminated against. Imagine, for example, that a homophobic employer fires a female worker because she marries a woman. But for that worker’s sex, she wouldn’t have been fired: Her boss has no issue with men marrying women, only women marrying women. The employee’s sex was fundamental to the discrimination she suffered—so it can therefore aptly be described as sex discrimination.

2. Sex stereotyping

The Supreme Court held in 1989’s Price Waterhouse v. Hopkins that sex stereotyping is a form of sex discrimination. Thus, when an employer mistreats a worker because she fails to conform to certain gender norms, it has engaged in discrimination “because of sex.” Initially, sex stereotyping was applied to masculine women and feminine men. But as the 7th Circuit pointed out, gay people are “the ultimate case of failure to conform” to sex stereotypes, which, in America, have historically held that men should date only women and women should date only men. By intimately associating with people of the same sex, gay individuals violate this stereotype. And so, when they are discriminated against because of their sexual orientation, they have suffered sex stereotyping.

3. Associational sex discrimination

Under this theory, anti-gay bias constitutes sex discrimination in much the same way that anti-miscegenation laws constitute racial discrimination. The Supreme Court has held that when a state prohibits a white person from marrying a black person, it has engaged in discrimination because of race. Similarly, the 7th Circuit ruled that when an employer mistreats a gay person for associating with a partner of the same sex, it has engaged in discrimination “because of sex.” Consider, for instance, a gay man who places a photo of his husband on his desk at work, and is fired for it. In effect, his employer is punishing him for being a man and intimately associating with another man. Change the sex of one partner and the discrimination disappears. This reveals, as the 7th Circuit wrote, that “the discrimination rests on distinctions drawn according to sex.”

This fall, the full 2nd U.S. Circuit Court of Appeals will evaluate these theories after the circuit’s chief judge essentially urged the court to adopt them. It is this litigation that spurred the Justice Department to declare that Title VII does not, in fact, protect gay employees. (Under President Barack Obama, the agency took no position on the matter, although it did determine that Title VII protects transgender workers.) By filing this brief, the DOJ has created an odd situation in which one federal agency (the EEOC) disagrees with another (the Justice Department) in federal court.

The DOJ’s primary argument is that Congress’ failure to add “sexual orientation” to Title VII—either in 1964 or in the years since—proves that the law does not currently cover gay employees. This theory is rather strange because the absence of legislative action is not typically considered to be a useful tool of statutory interpretation. Congress’ failure to act could mean that it does not wish for Title VII to encompass sexual orientation. But it could also mean that Congress believes the law already protects gay employees. More than 125 members of Congress recently signed a brief asserting their belief that Title VII currently bars sexual orientation discrimination. At the very least, the absence of clear legislative guidance on the matter is obviously ambiguous.

To repudiate the three theories of sex discrimination listed above, the DOJ deploys some extremely questionable logic:

In response to the “but-for” theory, it argues that homophobic employers discriminate against gay men and women equally, taking sex out of the equation. But sex cannot be removed from the equation. When an employer discriminates against a white woman for dating a black man or vice versa, it is still guilty of race discrimination: Race was obviously the key factor in its discrimination. Similarly, when an employer discriminates against a man for dating a man, it is guilty of sex discrimination, because sex was the foundational element of its bias.

In response to the sex stereotyping theory, the DOJ argues that gay men and lesbians may only raise a claim of sex stereotyping if they face discrimination because of their mannerisms—not because of their sexual orientation. So, according to the DOJ, a lesbian who “has masculine manners or clothing” may raise a sex stereotyping claim, but a traditionally feminine lesbian may not. Likewise, an effeminate gay man may suffer sex stereotyping, but a traditionally masculine gay man does not. To reach this conclusion, the DOJ asserts that employers may hold “moral beliefs” about sexuality that “need not be based on views about gender at all.” This argument simply defies logic. Homophobic employers may well hold “moral beliefs” about gay men and women. But those beliefs are always rooted in a stereotype about how men and women should behave.

In response to the associational discrimination theory, the DOJ argues that discrimination against gay people based on their intimate associations is unlike discrimination against interracial couples. The brief insists that discrimination against interracial couples is rooted in a belief that one race is superior to the other—and that true sex discrimination is similarly rooted in beliefs that one sex is “inferior.” But this presumption is utterly incoherent. Everyone knows that interracial marriage bans constitute race discrimination because they take the race of each partner into account. It’s no different with anti-gay discrimination: When an employer discriminates against a gay person, it is objecting to his intimate association with someone of the same sex. You simply cannot escape this fundamental sex-based consideration, which Title VII proscribes.

The left-leaning 2nd Circuit is almost certain to side with the EEOC and against the DOJ. But this fight is ultimately heading to the Supreme Court—and the Trump administration has now signaled loudly that it will encourage the justices to rule against gay employees. That may be disappointing to civil rights advocates, but it is not devastating to the cause. With arguments this unintelligible, the Justice Department seems unlikely to change anybody’s mind.