On Friday, North Carolina’s state Supreme Court ruled that banning registered sex offenders from social networking websites like Facebook and Twitter is constitutional, reversing an earlier decision by the North Carolina Court of Appeals.

In 2008, the North Carolina General Assembly passed a package of laws supported by Attorney General Roy Cooper barring registered sex offenders from using social media networks. The laws also included sentencing for “pornographers and child predators who use Internet websites to target victims,” according to a statement from Cooper’s office. In 2012, Lester Gerard Packingham, a registered sex offender from Durham, successfully challenged the law; the state Supreme Court reversed that ruling last week.

“Our laws bar convicted sex offenders from living near schools and working with young people in real life, and it’s just as important to protect kids in the online world,” Cooper said. “I pushed for this law to put another barrier between sex offenders and potential victims, and I’m pleased that the court has agreed with our arguments to keep this law in place.”

But civil liberties advocates say this kind of law infringes on peoples’ constitutional right to free speech and creates impediments to convicted offenders who are trying to reintegrate into society after serving prison time.

“Some of these social media platforms have become the new Town Square, where people interact with family members, where people have political discussions and organize protests and where they connect with friends and loved ones who live far away,” says Nathan Wessler, a staff attorney with the American Civil Liberty Union’s Speech, Privacy, and Technology project, who is based in New York.

“In today’s digital age, some social media platforms are some of the most consistent forms of free speech and association people are having, and by blocking people from using them, the Legislature and the courts are chilling their ability to engage in First Amendment protected activity.”

Wessler says this kind of legislation, though well-meaning, is over-broad; it misidentifies a problem it is directed at solving by banning everyone on the state’s sex offender registry, regardless of whether they are likely to use social media to commit a crime.

“What we know about sex crimes directed at children is, they are often perpetrated by family members and acquaintances,” says Wessler. “It comes up with a solution that doesn’t narrowly target the danger, and by blocking these people from using these platforms after they serve their time, it makes it more difficult for them to find employment and maintain strong family connections, important factors in making sure they can reintegrate and participate in all kinds of modern life.”

Wessler says other states have seen this kind of legislation, or variations on it where people report their social media user names to the government for monitoring. In states with an all-out social media ban like North Carolina’s— in Georgia, Indiana, Nebraska, Utah, Louisiana and California, for example—Wessler says that’s parts of those laws have been struck down.