The US Supreme Court on Monday declared as unconstitutional a 2008 North Carolina law barring registered sex offenders from accessing commercial social media sites where minors may become members or create personal pages or profiles.

The justices ruled that the law, used to prosecute more than 1,000 registered sex offenders, was a breach of the First Amendment because "cyberspace" amounted to the "modern public square." The court said the North Carolina law, which bars sex offenders from sites like Facebook and Twitter, "enacts a prohibition unprecedented in the scope of First Amendment speech it burdens."

Justice Anthony Kennedy, writing (PDF) for the majority, added that the law was too broad.

While we now may be coming to the realization that the Cyber Age is a revolution of historic proportions, we cannot appreciate yet its full dimensions and vast potential to alter how we think, express ourselves, and define who we want to be. The forces and directions of the Internet are so new, so protean, and so far reaching that courts must be conscious that what they say today might be obsolete tomorrow. This case is one of the first this Court has taken to address the relationship between the First Amendment and the modern Internet. 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.

The case was brought by Lester Packingham, who was convicted of having sex with a 13-year-old girl in 2002 when he was a 21-year-old college student. He served his time and registered as a convicted sex offender. As part of a Durham Police Department investigation into registered sex offenders, Packingham was prosecuted in 2010 for violating the statute but was given no prison time. He appealed the conviction on First Amendment grounds, all the way up to the Supreme Court.

Packingham broke the law when he took to Facebook to praise Jesus after he got a traffic ticket dismissed.

Man God is Good! How about I got so much favor they dismissed the ticket before court even started? No fine, no court cost, no nothing spent... Praise be to GOD, WOW! Thanks JESUS!

The high court noted that a "fundamental principle"—even one available to convicted sex offenders, is the First Amendment right to access "places where they can speak and listen, and then, after reflection, speak and listen once more."

Those places, the court concluded, include "Cyberspace."

"While, in the past, there may have been difficulty in identifying the most important places (in a spatial sense) for the exchange of views, today the answer is clear. It is cyberspace," the court wrote, and "social media in particular."

Social media allows users to gain access to information and communicate with one another about it on any subject that might come to mind... 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. These websites can provide perhaps the most powerful mechanisms available to a private citizen to make his or her voice heard.

The justices were mindful to note that child exploitation is a most serious crime and an "act repugnant to the moral instances of a decent people."

The court majority continued and noted that, for centuries, new technologies and "inventions heralded as advances in human progress have been exploited by the criminal mind."

"So it will be with the Internet and social media," Kennedy wrote.

Kennedy was joined by Justices Ruth Bader Ginsburg, Stephen Breyer, Sonia Sotomayor, and Elena Kagan. Justice Samuel Alito, saying he was "troubled by the implications of the Court's unnecessary rhetoric," wrote separately in a concurring opinion joined by Chief Justice John Roberts and Justice Clarence Thomas. Justice Neil Gorsuch, the newest member of the court, took no part in the case.

Alito, in agreeing that "the law in question cannot satisfy the standard applicable to a content-neutral regulation," also wrote that the majority spoke too glowingly about the Internet.

"I cannot join the opinion of the Court, however, because of its undisciplined dicta. The Court is unable to resist musings that seem to equate the entirety of the Internet with public streets and parks," Alito wrote. "And this language is bound to be interpreted by some to mean that the States are largely powerless to restrict even the most dangerous sexual predators from visiting any Internet sites, including, for example, teenage dating sites and sites designed to permit minors to discuss personal problems with their peers."

The majority, however, countered that the law might also apply to sites "as varied" as Amazon.com, Washingtonpost.com and Webmd.com. The justices said the states are free to criminalize criminal behavior online, but they cannot bar sex offenders from participating in a swath of speech being conducted online.

"Though the issue is not before the Court, it can be assumed that the First Amendment permits a State to enact specific, narrowly tailored laws that prohibit a sex offender from engaging in conduct that often presages a sexual crime, like contacting a minor or using a website to gather information about a minor," Kennedy wrote.

Still, the Internet has become too much a part of society, and therefore the states cannot adopt blanket exclusions from social media, Kennedy concluded.