Few things could be more distressing to grieving family members attending the funeral of a loved one than the sudden appearance of noisy demonstrators nearby waving obnoxious signs and shouting hate-filled obscenities. That's what happened to Albert Snyder, the father of a Marine lance corporal killed in Iraq in March 2006. The demonstration outside Matthew A. Snyder's funeral in Westminster by a fringe group of anti-gay zealots, during which protesters brandished such messages as "Thank God for Dead Solders" and "Semper Fi Fags," was as offensive and hurtful as it was seemingly random and pointless.

There was no particular reason why the group from Kansas-based Westboro Baptist Church chose Corporal Snyder's funeral as part of its insane crusade to convince Americans that military deaths in Iraq and Afghanistan are God's punishment for the nation's toleration of homosexuality. Corporal Snyder was not gay, but the group nevertheless used the solemn occasion of his funeral to garner publicity for its twisted views. In the end, the protest accomplished nothing more than increasing the suffering of Corporal Snyder's family. Adding insult to injury, a few days later the group posted a message on its website charging that Albert Snyder and his wife had "taught Matthew to defy his creator" and "raised him for the devil."

Understandably appalled by the demonstrators' outrageous behavior, Mr. Snyder sued the group in federal court for intentional infliction of emotional distress, harassment and invasion of privacy. A jury in Baltimore awarded him $11 million in compensatory and punitive damages, which the judge reduced to $5 million. But the 4th Circuit Court in Richmond, Va., overturned the award on the grounds that it violated the protesters' First Amendment right to freedom of speech. That court ruled that "as utterly distasteful" as the protesters' words were, "they involve matters of public concern, including the issue of homosexuals in the military, the sex- abuse scandal within the Catholic Church, and the political and moral conduct of the United States and its citizens" — and thus fell into the category of constitutionally protected speech.

Mr. Snyder appealed that decision, and today the U.S. Supreme Court heard arguments from both sides about whether to reinstate the $5 million judgment against Westboro. While we believe that decent people everywhere empathize with the pain and suffering inflicted on Mr. Snyder's family, and that the nation as a whole owes him the assurance that we honor his son's sacrifice and condemn the actions of Westboro pastor Fred Phelps, it would be wrong for the court to rule those actions illegal.

No matter how odious and repugnant the demonstrators' words may have been, the First Amendment's guarantee of freedom of speech would mean nothing if it didn't protect exactly those types of speech that are most unpopular and offensive. It is critical to the proper functioning of a democracy that debate on matters of public import be "uninhibited, robust and wide open," the court has ruled in previous cases. As former Justice William O. Douglas wrote in a famous dissent in a 1973 obscenity case, "the First Amendment was designed to invite dispute, to induce a condition of unrest, to create dissatisfaction with conditions as they are and even to stir people to anger."

As crazy as Mr. Phelps and his followers are, they legitimately exercised their rights to political speech within the reasonable restrictions imposed by the state. The Westboro protesters stayed within a designated area 1,000 feet away from the funeral, and they did not make contact with Mr. Snyder's family.

In scrupulously obeying the law by observing the reasonable restrictions on time and place that the Constitution allows, the Westboro protesters' acts were similar to other free-speech controversies in recent decades involving odious and obnoxious speech, including a planned 1977 Neo-Nazi march through a neighborhood in Skokie, Ill., that was home to many Holocaust survivors; a 1990 case involving the burning of a U.S. flag on the steps of the Capitol in Washington to protest American foreign policies; and a 1988 case involving a porn magazine's cartoonish insinuation that a famous televangelist had sex with his mother.

In every case, the court upheld a half-century of precedents giving even the most controversial and vile speech constitutional protection. That may be of little comfort to Mr. Snyder and his family, who saw the protests on television and read the hateful postings about them on the church's website. But it is a principle the Supreme Court should uphold.