Justice Samuel A. Alito Jr. filed a separate concurrence saying that the law “blatantly discriminates based on viewpoint,” a grave First Amendment sin.

Chief Justice Roberts took a more benign view of the law, even as he struck it down. He rejected the challengers’ assertion that the law was aimed at speech based on its content. It is true, he said, that the law is limited to reproductive health care facilities.

But state lawmakers acted “in response to a problem that was, in its experience, limited to abortion clinics,” the chief justice wrote.

Justice Scalia said that was naïve. “It blinks reality to say, as the majority does, that a blanket prohibition on the use of streets and sidewalks where speech on only one politically controversial topic is likely to occur — and where that speech can most effectively be communicated — is not content based,” he wrote.

Chief Justice Roberts also said that several exemptions in the law — for people going into or coming out of the building, people using the sidewalk to get somewhere else, law enforcement officials and the like, and clinic employees — were permissible and not aimed at allowing people of one viewpoint to have greater speech rights. “There is nothing inherently suspect about providing some kind of exemption to allow individuals who work at the clinics to enter or remain within the buffer zones,” he wrote.

Justice Alito disagreed. “Critics of the clinic are silenced,” he wrote, “while the clinic may authorize its employees to express speech in support of the clinic and its work.”

The majority opinion was notable for leaving open the door to other efforts to protect abortion clinics, which is probably why the court’s liberal members were willing to join it.