Sex offenders are probably the most marginalized group in society (ahead only of cannibals?) so it must be the rare case indeed where the Supreme Court rules unanimously in their favor. No, this isn’t a situation where some state decreed that anyone accused of a sex crime be chemically castrated without trial or any other kind of Eighth Amendment (cruel and unusual punishment) or due-process claim. Instead, a man who served his time and was released subject to the normal set of registration and living restrictions was sent back to prison because he accessed Facebook. Monday, all eight justices (Neil Gorsuch not having participated) held that this violated the First Amendment.

Let’s dive into the bizarre facts of the case. Lester Packingham, who had served time for “taking liberties with a minor” when he was 21 and she was 13, beat a parking ticket and celebrated by proclaiming on his Facebook page that “God is good! … Praise be to GOD, WOW! Thanks JESUS!”

For this grave offense against humanity, he was returned to the big house under a North Carolina statute that bans such people from accessing a wide variety of websites.

The law is meant to prevent communications between sex offenders and minors, but it sweeps more broadly than any other such law in the country. It doesn’t even require the state to prove that the accused had contact with (or gathered information about) a minor, or intended to do so, or accessed a website for any other illicit purpose.

Accordingly, the state court of appeals overturned Packingham’s conviction, but the state supreme court, over vigorous dissent, reinstated the conviction and sentence. The U.S. Supreme Court has now had the final word, finding that the North Carolina law wasn’t “narrowly tailored to serve a significant governmental interest.”

Translating from the legalese, this means that the state legislature slapped down a broad law that didn’t closely track the social problem it was supposed to target. As the Supreme Court explained, citing Cato’s amicus brief, the law may well bar access not only to social media but to any site where someone creates a profile and interacts with people—including the likes of Amazon, YouTube, and WebMD, or even the Washington Post and New York Times.

But even restrictions on social media alone would be troubling if not further tailored, the Supreme Court announced. Indeed, Justice Anthony Kennedy’s opinion is an encomium to the importance of web-surfing: “By prohibiting sex offenders from using those websites, North Carolina with one broad stroke bars access to what for many are the principal sources for knowing current events, checking ads for employment, speaking and listening in the modern public square, and otherwise exploring the vast realms of human thought and knowledge.” (The next time my wife tells me that I’m spending too much time on Facebook and Twitter, I’ll reply that I’m simply enriching myself with the wealth of human knowledge.)

There are other problems with the statute, such as its vagueness. Someone subject to this law literally can’t know what he can’t do or say; the police themselves aren’t sure!

Finally, the statute also fails constitutional scrutiny because it criminalizes speech based on the identity of the speaker. As Kennedy put it, “[e]ven convicted criminals—and in some instances especially convicted criminals—might receive legitimate benefits from these means for access to the world of ideas, in particular if they seek to reform and to pursue lawful and rewarding lives.”

The very purpose of the First Amendment is to protect the speech of disfavored minorities. Signaling out this speech for prosecution—without any allegation that it relates to conduct or even motive—has earned the Tar Heel State a big “dislike” from the Supreme Court.