WASHINGTON—The Supreme Court on Friday agreed to consider whether North Carolina can bar individuals on the state’s sex-offender registry from accessing social-media websites such as Facebook.

The high court, in a brief written order, agreed to take up the appeal of Lester Packingham, who was convicted of violating the social-media ban after a Durham, N.C., police officer in 2010 found a Facebook post in which the defendant happily announced the dismissal of a traffic ticket. “Man God is Good!” the post said.

Mr....