IN 2009 President Obama signed a federal bias crimes law named for the victims of two gruesome 1998 atrocities: the young gay man who was tortured, lashed to a fence and left to die; and the black man chained to the back of a pickup by white supremacists and dragged until he was dismembered. The Matthew Shepard and James Byrd Jr. Hate Crimes Prevention Act joined a 40-year accumulation of statutes declaring that crimes committed with a mind full of racial spite or anti-Semitism or homophobic hatred should be punished more severely than identical crimes committed for greed or vengeance.

Today the notion is embedded in our culture. Almost every state has some variety of hate crime law. The most recent F.B.I. count, for 2010, reports 6,628 “criminal incidents” involving bias — instances where local authorities judged that the offender was motivated by hatred of a particular group. The Supreme Court unanimously upheld disparate penalties for bias crimes in 1993. The A.C.L.U., after years of resisting, endorsed a hate crime bill in 2005.

But the fact that it is constitutional and commonplace does not quiet the nagging sense that hate crime legislation resembles something from an Orwell dystopia. Horrific crimes deserve stern justice, but don’t we want to be careful about criminalizing a defect of character? Because our founders believed that democracy requires great latitude for dissent, America, virtually alone in the developed world, protects the right to speak or publish the most odious points of view. And yet the government is authorized to punish you for thinking those vile things, if you think them in the course of committing a crime.

The issue is back with us thanks to the heartbreaking deaths of two teenagers. One is Tyler Clementi, the Rutgers student who jumped to his death from the George Washington Bridge after his roommate surreptitiously, briefly, video-streamed him kissing another man. The other is Trayvon Martin, the black Florida youngster shot dead by a neighborhood watch volunteer. Clementi’s roommate, Dharun Ravi, was convicted not only of invading Clementi’s privacy and intimidating him, but of acting with an anti-gay bias that could add up to 10 years of prison to his sentence. The shooter in the Trayvon Martin case, George Zimmerman, has not been charged with anything, but politicians are already slinging the h-word.