Maybe, but to be consistent you’d have to agree that it would be within the rights of states to also pass the same law for books, movies, music, etc...
They can, at least for books and movies if those books and movies have naked pixs in them.
Actually, even extreme violence can restrict those under 17 from access to a movie.