Today the Supreme Court unanimously overturned a North Carolina law that bans registered sex offenders from any "commercial social networking Web site" that is open to minors. With the exception of Neil Gorsuch, who did not participate in the case because he was not on the Court when it was argued, every justice agreed that the law's broad scope cannot be reconciled with the First Amendment.

The case was brought by Lester Packingham, who at the age of 21 had sex with a 13-year-old girl and was convicted of taking indecent liberties with a minor. Eight years later, Packingham beat a traffic ticket and expressed his pleasure on Facebook: "Man God is Good! How about I got so much favor they dismiss the ticket before court even started. No fine, No court costs, no nothing spent….Praise be to GOD, WOW! Thanks JESUS!" That burst of online exultation violated North Carolina's ban on social media use, which covers all registered sex offenders, regardless of whether their crimes involved minors or the internet.

Packingham argued that his conviction violated the First Amendment, and a state appeals court agreed. The North Carolina Supreme Court did not. Siding with Packingham today, the U.S. Supreme Court concludes that the law "burden[s] substantially more speech than is necessary to further the government's legitimate interests."

Writing for the majority, Justice Anthony Kennedy emphasizes the internet's vital importance to freedom of speech. "This case is one of the first this Court has taken to address the relationship between the First Amendment and the modern Internet," he says. "As a result, the Court must exercise extreme caution before suggesting that the First Amendment provides scant protection for access to vast networks in that medium."

Kennedy says North Carolina's law "enacts a prohibition unprecedented in the scope of First Amendment speech it burdens," applying indiscriminately to many kinds of online activity, even when it has nothing to do with contacting minors. "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," he writes. "These websites can provide perhaps the most powerful mechanisms available to a private citizen to make his or her voice heard….To foreclose access to social media altogether is to prevent the user from engaging in the legitimate exercise of First Amendment rights."

In a concurring opinion joined by John Roberts and Clarence Thomas, Samuel Alito notes that the law's broad definition of "commercial social networking Web site" covers not only widely used social media platforms like Facebook and Twitter but also shopping sites such as Amazon and news sites such as The Washington Post. Alito says the law's "staggering reach…makes it a felony for a registered sex offender simply to visit a vast array of websites, including many that appear to provide no realistic opportunity for communications that could facilitate the abuse of children."

The Court's decision in Packingham v. North Carolina not only vindicates the First Amendment but provides a welcome dose of skepticism about sweeping, indiscriminate laws that are supposedly justified by the need to protect children from sexual predators. In this case, as in many others, the law went far beyond that goal, criminalizing a wide range of innocent actions by people classified as sex offenders, most of whom pose no real threat to children.