When was the last time Justice Clarence Thomas provided the decisive fifth vote to the U.S. Supreme Court's four liberals — to decide against free speech? I can't think of one, but that's what happened Thursday in the court's decision in Walker v. Sons of Confederate Veterans, better known as the Texas license plate case.

In an opinion written by Justice Stephen Breyer, the four liberals and Thomas held that Texas could bar the state chapter of the Sons of Confederate veterans from creating customized license plates — under a process that authorizes some 350 plate configurations — because the plates are government speech and so the First Amendment doesn't apply. The court's four other conservatives, including Justice Anthony Kennedy, probably the court's most aggressive free speech absolutist, said that Texas was engaging viewpoint discrimination.

To understand the result, you have to divide the court's legal analysis from the reasons that explain Thomas' fifth vote. Start with the law, which itself makes sense only if you know something about how the Supreme Court expanded the idea of free speech to cover certain kinds of government-sponsored programs.

The crucial decision here was a 1995 ruling called Rosenberger v. Rector and Visitors of the University of Virginia. There, in an opinion by Kennedy, the court said that the university couldn't engage in viewpoint discrimination when it doled out money from a student activity fund. The fund, Kennedy reasoned, was a "metaphysical" version of a public forum for speech. "Metaphysical" was an awkward (and inaccurate) word to use, but what Kennedy meant to say was that the freedom of speech applied even though there was no physical space or forum in which people's speech was being restricted. By giving out the money, the government (via the state university) created a forum. And in that forum, the government couldn't prefer some speech to other speech.

The Rosenberger doctrine of the virtual public forum has been applied most prominently in cases involving advertising space on public transportation. Typically when somebody wants to place an offensive ad on a bus or train, the government objects via the transportation authority — and courts consistently hold in favor of the nasty speakers.

But the problem with the virtual public forum is that it potentially goes too far. In a 2009 case called Pleasant Grove v. Summum, the court looked the doctrine squarely in the face — and blinked. A dissident religious group wanted to erect a monument in a public park in a Utah suburb, and claimed the park was a public forum because various civic groups had been allowed to place monuments there. The court, worried that allowing the Summum monument would open the door for anyone to place any monument permanently in a public park, said that the decision of placing the monument was government speech.

"Government speech" is a magic constitutional doctrine: The minute it's invoked, the free speech clause of the First Amendment disappears. The idea is that only private parties have free-speech rights. If the government's talking, then you aren't — so you have no free-speech claim.

Breyer invoked the Summum case and the government speech doctrine to decide the Texas license plate case. By saying that the license plates are all government speech, he could avoid the difficult problem of the government obviously picking and choosing which messages seemed appropriate — which would otherwise be an obvious form of viewpoint discrimination violating the First Amendment. The government speech doctrine worked its magic.

Justice Samuel Alito, joined by the conservatives minus Thomas, was having none of it. He gleefully ripped holes in the government speech claim, asking whether you think the state of Texas endorsed the message "Rather Be Golfing" or, worse, out-of-state universities including the University of Oklahoma. On a football weekend, Alito pointed out, the latter endorsement from the state of Texas would be tantamount to treason.

Obviously Alito is right that no one thinks Texas is actually endorsing the organizations that sponsor license plates. What's really going on — not that Breyer quite said so — is that Texas is operating more like a corporation than a government. It's happy to take your money to sponsor almost any license plate configuration — unless your message harms the brand. The Confederate battle flag proposed for the license plate in question offended the sensibilities of some Texans. That's why it was excluded.

Which brings us to Thomas' vote. There's a reasonable legal argument to be made that the virtual public forum doctrine needs to be limited so that the government can choose its message in the same way as a private corporation would — especially when the government is basically selling advertising space on license plates. Perhaps the liberals might be willing to follow this doctrinal direction even in a public transportation case, which would at least be consistent.

But why did Thomas, who is generally strongly in favor of free speech and issued a strongly pro-speech opinion Thursday in another case, Reed v. Town of Gilbert, join Breyer here? The answer is almost certainly that he was repulsed by the image of the Confederate battle flag on the license plate of the formerly segregationist state. The image of the proposed plate is reproduced in full color in the court's opinion — and it looks as if Texas is embracing the Confederacy.

In a 2003 case, Virginia v. Black, Thomas wrote a separate opinion to say that cross-burning shouldn't be treated as a form of symbolic speech protected under the First Amendment. The burning cross, he said, was a marker of terror and intimidation, not a form of political speech. He didn't write separately here, but his anomalous vote speaks volumes. The court's sole black justice was telling us that the Confederate battle flag still means something — and the state shouldn't have to allow it just because it makes some money letting people brag about their golfing on their license plates.

Noah Feldman, a Bloomberg View columnist, is a professor of constitutional and international law at Harvard.