Protesters gather as Governor Pat McCrory makes remarks about HB2 in Raleigh, North Carolina.Gerry Broome / AP

Pat McCrory, the beleaguered governor of North Carolina, says he signed the controversial “bathroom bill”—HB2—because cities’ local gay-rights laws were “local government overreach.” When the U.S. Department of Justice notified him that the bill likely violated the Civil Rights Act of 1964, he angrily called it “Washington overreach.”

Now he says, “It’s time for the U.S. Congress to bring clarity to our national anti-discrimination provisions.” That wouldn’t be overreach.

By the time you read this, he may be calling for United Nations intervention.

It’s easy to see why McCrory doesn’t know which way to turn. On Monday, the state and the federal government sued each other over the bill, which (among other things) requires anyone using bathrooms in public schools and agencies to use only those designated for the sex noted on their birth certificates—thus barring transgender employees and students from using the bathroom consistent with their gender identities. The federal government contends, and the weight of legal authority—including in the Fourth Circuit, North Carolina’s home—has found, that discrimination against employees or students on the basis of trans status is discrimination “because of sex” and is thus barred by the Civil Rights Act of 1964. HB2 does that; indeed, discrimination against trans people is its whole purpose.

But McCrory has a bigger problem: HB2 is also unconstitutional. Not just the bathroom provisions—the whole thing.

To understand why, go back to the 1996 case of Romer v. Evans, the first major victory for gay rights in the Supreme Court. In 1992, the voters of Colorado had amended their state constitution to provide that no state agency, city, or county could make “homosexual, lesbian or bisexual orientation, conduct, practices or relationships … the basis of … minority status, quota preferences, protected status or claim of discrimination.”

In Romer, the Court struck down Colorado’s “Amendment Two,” holding:

[T]he amendment has the peculiar property of imposing a broad and undifferentiated disability on a single named group, an exceptional and, as we shall explain, invalid form of legislation. Second, its sheer breadth is so discontinuous with the reasons offered for it that the amendment seems inexplicable by anything but animus toward the class it affects.

Romer’s language—and the concept of “animus”—may hold the key to the cloudy future of HB2. Much of the law has nothing to do with bathrooms and really isn’t even about trans people in particular. HB2 has a larger goal: to thwart any movement toward equality for the state’s entire lesbian, gay, bisexual, and transgender community. The bathroom rules occupy only one part of a five-part bill. Part II says that no city or county can require its contractors not to discriminate against employees or customers based on sexual orientation. Part III invalidates all present city and county ordinances protecting LGBT people from discrimination in private employment and public accommodations. It provides that only the state legislature can enact such a law from now on. Good luck with that one.

The state, in other words, has declared open season for discrimination on sexual orientation. That is mean-spirited, to be sure. But does it violate the Constitution?

Again, go back to Romer v. Evans—the answer begins there and branches out. The North Carolina law has almost the same effect as Colorado’s Amendment Two, but its language is quite different. The Colorado measure said no law could protect gays and lesbians; it didn’t say that no law could protect straights against discrimination by gays, if that were to become rampant. It was textually aimed only at one group—as Justice Anthony Kennedy’s opinion said, “not to further a proper legislative end but to make [that group] unequal to everyone else.” That broad language made the measure an easy target for the Court, which said it “lack[ed] a rational relationship to legitimate state interests”—constitutional-speak for, This law is so mean that its only possible purpose is to hurt gays and lesbians.

HB2 doesn’t mention sexual orientation or transgender status; it simply lists the traits that canbe protected from discrimination: “race, religion, color, national origin, or biological sex.” (“Biological sex” is intended to block any local sex-discrimination statute from applying to trans people. Note also that sexual orientation is not protected in HB2.) Localities, the bill says, cannot protect any other groups. That reads differently from Colorado’s Amendment Two; for one, it doesn’t mention LGBT people. Further, it doesn’t invalidate any possible policy or law protecting them (as Amendment Two did) but only those laws aimed at employment discrimination or public accommodations. It’s a harder target than Amendment Two.

Federal civil-rights laws don’t protect against discrimination by sexual orientation. States certainly don’t have to. And the Court has held that states can, under certain circumstances, even repeal civil-rights laws already on the books.

But HB2 doesn’t just repeal the existing civil-rights ordinances protecting the LGBT community; it bars any locality or agency from enacting new ones. That bar was one of the flaws in Amendment Two; similar bars were seen as yellow flags in a series of cases decided by the Burger Court about the repeal of state and local discrimination laws. In these cases, protections against race discrimination were not only repealed but also permanently removed from local decision-making. The bar on such measures is not absolute. Three terms ago, the Court was more forgiving of a Michigan referendum that enacted a state-constitutional ban on local university affirmative-action programs. That measure was all right, the Court reasoned, because affirmative action is not a prohibition on discrimination, like a civil-rights statute, but instead a “political polic[y]” that some argue helps minorities.

HB2 bars basic protections against discrimination, not debatable policies that may or may not benefit LGBT people. And there’s a second factor at work here—a clear legislative purpose much like the one that the Romer decision called “inexplicable by anything but animus toward the class it affects.” “Animus” doesn’t have to mean lynch-mob hatred; as near as one can tell, the term means simply a conscious determination that one class of people don’t deserve or need rights or benefits available to everybody else. In Romer, Kennedy found animus in the text and structure of Amendment Two itself, noting how it singled out gays and lesbians for a burden it put on no one else.

Defenders of HB2 can argue that it disadvantages not just LGBT people but others who may want civil-rights protection, such as veterans, for example. That might be a good argument—if Parts II and III were freestanding bills. But HB2 has to be read as a whole, and if it is, the outlines of animus are clear. This bill is, not to put too fine a point on it, obsessed with sex, with genitals, with the sexuality of transgender people, and with the entire LGBT community. As a whole, it first stigmatizes and restricts transgender people, and only then goes on to sweep away existing protections against sexual-orientation discrimination. Its justification seems to be a fear of trans people as criminals and sex offenders. There is no evidence, other than hateful stereotype, that they are either.

Even from a cold computer screen, the stench of animus assails the nostrils.

If a court finds the measure was born of animus, it could and should strike it down without more. HB2, like Amendment Two, is a constitutional monstrosity.

One of Anthony Kennedy’s favorite legal maxims comes from The Common Law by Oliver Wendell Holmes Jr.: “Even a dog distinguishes between being stumbled over and being kicked.” Legislators in Raleigh have had their shot at kicking. It would be only just if the courts now administered a few kicks to them.