Parents may wonder how the Supreme Court could overturn a California law that made it a crime to sell or rent violent video games to minors. But the court got it right Monday in Brown v. Entertainment Merchants Association. The justices rejected a radical challenge to free speech — in the process protecting all of us, not just children.

Although video-game software is cutting-edge, the underlying issue is a century old. For decades, courts have overturned laws intended to preserve children’s morality by restricting access to penny arcades, movies, rap music and cable television. Without exception, courts have ultimately rejected state and municipal statutes limiting youth access to video games because they violate the most basic free-speech principles. As Justice Antonin Scalia explained in the majority’s opinion Monday: All speech that communicates ideas, including video games, is protected. It is “difficult to distinguish politics from entertainment, and dangerous to try.”

The California law had numerous flaws. It ignored the basic tenet that any law limiting speech must inhibit no more speech than necessary to accomplish its goal. The justices properly found that there was a less heavy-handed way of helping parents guide their children’s upbringing according to their own values: the voluntary industry rating system for video games, which the Federal Communications Commission in 2009 called “one of the most robust voluntary rating systems available.” California’s statute also lumped together children of all ages, despite labeling that distinguishes suitability for different age groups, and the court understood that the law violated the rights of some parents, who might not care what games their children play, by dictating “what the State thinks parents ought to want.”

California also failed to show that restricting video games served the “compelling interest” that is a prerequisite for any government inhibition on speech. The state claimed that limiting access to violent video games would protect young brains and psyches from “psychological and neurological harm,” resting its case on the alleged authority of social science. Like every lower court that has considered the studies the California legislature invoked, the Supreme Court was underwhelmed by the so-called evidence. The “studies show at best some correlation” between violent video games and children’s development, the court said, and “those effects are both small and indistinguishable from effects produced by other media.”

Further, California’s statute ignored the established principle that children have First Amendment rights. Scalia, not a predictable proponent of juvenile rights, noted that the state does not have “a free-floating power to restrict the ideas to which children may be exposed.” The young have rights for good reasons. One is that children become voters overnight at age 18. Moreover, at 18 they can enlist in the armed forces, where they encounter violence firsthand. The law understands that no bright line separates infancy from maturity; the gradual process of becoming an adult requires exposure and testing. Even at school, under the watchful eye of authorities, children have the right to express opinions as long as they do not materially disrupt the educational process. The court pointed out that books from “Grimm’s Fairy Tales” to “The Odyssey” to “Lord of the Flies” are full of gruesome, gratuitous violence. Many great works of art could be off-limits to minors if offensive levels of violence were the litmus test, leaving youths unprepared to cope with the responsibilities of citizenship.

More broadly, California’s cynical approach to the rule of law threatened all of us. Since 1954, the Supreme Court has held that the First Amendment protects violent content. Yet California argued that violent video games should fall outside the First Amendment’s purview and invited the court to add to the very narrow list of categories of content deemed outside the protections of the First Amendment’s speech clause. Alternatively, California tried to shoehorn violent video games into the complex definition of obscenity. This was a huge stretch. Whatever obscenity is or is not, it has long been clear that it has always been limited to sexual prurience.

If violent content were denied constitutional protection, violence would prove at least as hard to define in context as obscenity. An expanded category of unprotected, criminalized speech, treating violence as obscenity, raises the specter of self-censorship by those who fear prosecution for vaguely defined transgressions. This might also limit adults to content “suitable for the sandbox.”

As the First Amendment requires, the Roberts court has forcefully stood up for even the most vile speech. This year the court safeguarded protesters’ outrageous, hurtful speech at the funeral of a fallen Marine; last year, it overturned a federal statute limiting depictions of animal cruelty. Scalia explained that the same principle applies to animal cruelty and violent video games: Neither can be limited because legislators conclude they are just too harmful to be tolerated.

California expressly invited the courts to go where no court had gone before. By rejecting this radical path, the justices protected our children by preserving our liberty.

Catherine J. Ross is a professor at George Washington University Law School and is writing a book on the First Amendment and public schools.