Just as it did last year in the Citizens United decision, the Supreme Court today upheld the First Amendment in a virtually unanimous opinion in a very difficult case. In Snyder v. Phelps, the Court held that the First Amendment shields the Westboro Baptist Church from a state tort claim.

Albert Snyder filed a lawsuit in Maryland against the founder and members of the church for intentional infliction of emotional distress, intrusion upon seclusion, and civil conspiracy after they picketed the funeral of Snyder’s son, Matthew Snyder, a Marine Lance Corporal killed in Iraq in the line of duty.

The Westboro Church, which was founded by Fred Phelps 20 years ago, is infamous for its picketing of military funerals over its belief that God hates the United States—particularly its military—for tolerating homosexuality. Phelps and other members of his congregation staged a protest on the day of Matthew Snyder’s funeral on a public plot of land 1,000 feet from the church where the funeral was being held. They followed all of the instructions of local police, and the protest was peaceful, although it was full of hateful signs like “Thank God for Dead Soldiers.” Albert Snyder admitted that he could only see the tops of the picket signs as he drove to the funeral, although he saw what was written on them while watching a news broadcast later that night and read a truly outrageous “epic” poem written about how he and his wife had effectively “ripped” his son’s body apart and raised him for the devil.

There is no question about the anguish that Snyder suffered due to this protest at a time of incalculable grief. A jury saw it that way and awarded Snyder both compensatory and punitive damages.

But in an opinion written by Chief Justice John Roberts, the Supreme Court struck down the judgment. As Roberts pointed out, speech on public matters occupies the highest rung of protection under the First Amendment, even when that speech is “particularly hurtful.” As the Chief Justice wrote, the messages of the Westboro Church “may fall short of refined social or political commentary,” but the content of Westboro’s signs plainly related to public, rather than private, matters: the opinion of the church on “the political and moral conduct of the United States and its citizens, the fate of our Nation, homosexuality in the military, and scandals involving the Catholic clergy.”

Westboro’s choice of where and when to speak is not beyond the government’s regulatory reach—it is subject to reasonable time, place, and manner restrictions. The Court noted that new laws in Maryland will restrict the location of picketing even more, but Westboro had complied with the state law then in place for its picketing. The Court declined to extend the “captive audience doctrine” to the circumstances present in this case, because Westboro stayed well away from the memorial service and there was no interference with the funeral service itself.

There is no question that Albert Snyder was absolutely right to be outraged at the horrible, hateful things being said by the Westboro Church at a time when his family was dealing with something that every parent never wants to face—the death of his or her child. Reasonable jurists (including Justice Samuel Alito) disagreed about whether this speech was so outrageous and the special facts of the case so unique that it constituted the tort of intentional infliction of emotional distress, but all the justices reminded us in the opinion today that the First Amendment normally protects even hateful, vile, and disgusting speech in the public square.

Chief Justice Roberts’s final words on this issue are very powerful and illustrate not just the difficulty that the Court faced in this emotionally charged case but the basis of the First Amendment in our Bill of Rights:

Speech is powerful. It can stir people to action, move them to tears of both joy and sorrow, and—as it did here—inflict great pain. On the facts before us, we cannot react to that pain by punishing the speaker. As a Nation we have chosen a different course—to protect even hurtful speech on public issues to ensure that we do not stifle public debate.

Justice Alito filed a passionate 14-page dissent, noting that the bereaved father is not a public figure, and yet, he suffered a “malevolent verbal attack … at a time of acute emotional vulnerability … [from which he] suffered severe and lasting emotional injury.” Alito argued that the protesters have almost limitless opportunities to express their views, even in a caustic manner, but vicious verbal attacks that constitute the tort of intentional infliction of emotional distress—including the requirement that the harm was severe (“so severe that no reasonable man could be expected to endure it”) and so outrageous to go beyond all bounds of decency—are not among them. In particular, Alito argued, funerals are recognized by society as special and worthy of special protection.

This was one of those cases where bad facts or public opinion could have made bad law. But the Court did not allow public opinion or emotional appeals to govern this case. Whether citizens agree with the Court’s eight-member majority or Justice Alito on the facts of the case today, we should all be grateful that the justices take upholding free speech and the protections of the First Amendment so seriously, even when demagogues try to characterize their First Amendment decisions as nothing more than political decisions favoring certain people and entities they like.

Co-authored by Todd Gaziano.