The U.S. Supreme Court building in Washington,D.C., Nov. 15, 2016. Reuters

North Carolina law makes it illegal for registered sex offenders to access social media sites like Facebook, Snapchat and Instagram. The U.S. Supreme Court was hearing oral arguments Monday in a challenge to that law, and it could decide if social media access is protected under the First Amendment of the Constitution.

In April 2010, then-29-year-old Lester Packingham had a traffic ticket dismissed, so the North Carolina man decided to celebrate on Facebook.

"God is Good!" Packingham posted on the social media site. "How about I got so much favor they dismissed the ticket before court even started. No fine, no court costs, no nothing spent... Praise be to GOD, WOW! Thanks JESUS!"

That seemingly innocent post was a criminal act under a 2008 North Carolina law that made it illegal for any registered sex offender to access a social networking site "where the sex offender knows that the site permits minor children to become members" or "create or maintain personal Web pages." Packingham became a registered sex offender after he was convicted of taking "indecent liberties" with a 13-year-old girl when he was 21 in 2002.

Packingham sent his celebratory post under the name "J.r. Gerrard," but Durham, North Carolina, police officer Brian Schnee recognized the account as Packingham's and obtained a warrant to search his residence. The search showed that Packingham had illegally opened a Facebook account. There was no evidence, however, that Packingham used his Facebook account to communicate with minors.

Packingham was convicted of a felony for accessing Facebook under the North Carolina law, which applies to 20,000 North Carolina residents and has been used in 1,000 prosecutions, according to the Marshall Project. The law makes no distinction between sex offenders who are accessing social media sites for illicit purposes and those, like Packingham, who are simply sharing their joy over a dismissed parking ticket.

RTX2Z6TC (1)
The Facebook logo is displayed on their website in an illustration photo taken in Bordeaux, France, Feb. 1, 2017. Reuters

First Amendment advocates argue that barring sex offenders from social media could prevent them from applying to jobs and accessing information protected under the First Amendment. The Reporters Committee for Freedom of the Press, the National Association of Criminal Defense Lawyers, the Cato Institute and the Electronic Frontier Foundation all filed amicus briefs in support of Packingham.

In court filings, Packingham has argued that the Supreme Court "has made clear that receiving and ‘gathering’ information are activities fully and independently protected under the First Amendment, not conduct that may be freely regulated and punished."

Meanwhile, the state of North Carolina argues that the law protects children. "It blinks reality to suggest that sexual predators do not use social media to further their crimes," the state said.

Previous court rulings have found that similar Nebraska and Indiana laws that widely banned sex offenders from accessing social media were unconstitutional. Part of the reason courts found these types of laws unconstitutional was that they didn't just restrict social media use as a condition of parole or probation but instead made accessing social media illegal for every sex offender.

A state appeals court overturned Packingham's conviction, but the North Carolina Supreme Court eventually reinstated his conviction, ruling that the law was "narrowly tailored to serve a substantial governmental interest" and left "ample alternative channels of communication" for sex offenders. The U.S. Supreme Court agreed to hear Packingham's appeal last fall.