Those who cheer the arrests of the University of Connecticut students might ask themselves whether they would be equally happy with a prosecutor who decided that it was criminal “ridicule” for someone to walk down the street uttering a racial slur while reciting rap lyrics. But that’s not ridicule, you say? Well, that’s the point: Who should be trusted to decide such things when fines, jail time and expulsion from college loom as possible consequences?

Second, federal courts consistently have struck down speech codes at public universities that punished students who engaged in undefined “acts of intolerance” or who “stigmatized” others based on their race, religion, sexuality or other characteristic. One such decision invalidated a university speech code that imposed discipline for “threats, insults, epithets, ridicule or personal attacks.”

The reasoning in those cases — that speech may not be censored or punished for its content — also applies in the University of Connecticut case. Here, there was not even an identifiable target of the offensive speech, just a bystander with a cellphone. (Moreover, it appears that the Connecticut law, which was enacted a century ago, was intended to apply only to some form of “advertisement,” making the use of the law to criminalize the students’ speech even more misguided.)

To be sure, speech may be punished when the words used are likely to produce what the Supreme Court has called “imminent lawless action,” such as physical violence. But this leads to the third reason Connecticut’s anti-ridicule statute is unconstitutional. The Supreme Court case that established that rule, Brandenburg v. Ohio in 1969, involved the prosecution of Ku Klux Klansmen who were filmed uttering repulsive racist statements — including the N-word. But as in the case of the University of Connecticut students, the Klansmen’s words provoked no action, and the Ohio law under which the men were prosecuted was struck down under the First Amendment.

In the face of an absurd statute like Connecticut’s anti-ridicule law, it is tempting to extol the value of satire, irreverence and cheek as part of our country’s robust free-speech traditions. But this is not the time for that. Racial, ethnic, sexual and religious slurs exact a social cost. They deprive members of the affected groups of their dignity and inhibit their participation in our democracy as equal citizens.

But it is possible to hold that thought in mind while keeping in mind another thought: that we do not want the police or prosecutors — or university administrators, who too often cave in to public pressure in such situations — wielding the power to decide what constitutes “ridicule” and when someone should be hauled up on charges for engaging in it.

Steve Sanders (@SteveSSanders) is a professor at the Maurer School of Law at Indiana University.

The Times is committed to publishing a diversity of letters to the editor. We’d like to hear what you think about this or any of our articles. Here are some tips. And here’s our email: letters@nytimes.com.

Follow The New York Times Opinion section on Facebook, Twitter (@NYTopinion) and Instagram.