The Supreme Court just ­ensured that the nation’s homelessness crisis will continue. The high court declined to take up an appeal of a ruling by the Court of Appeals for the Ninth Circuit, covering the western United States, that homeless ­encampments are a de facto constitutional right.

The Ninth Circuit has a long history of reading the law as if its judges are actors in an absurdist play; in the encampment case, stemming from a Boise, Idaho, ­ordinance, it truly lived up to its cracked standards. The court maintained that enforcing a prohibition against camping in public places is a violation of the Eighth Amendment’s prohibition against cruel and unusual punishment.

A quick reminder. The Eighth Amendment says, “Excessive bail shall not be required, nor excessive fines imposed, nor cruel and unusual punishment inflicted.” It was adopted out of fear that Congress might, as Abraham Holmes put it, mimic the sorry experience of “that diabolical institution, the Inquisition,” or in the words of Patrick Henry, “introduce the practice of France, Spain and Germany of torturing, to extort a confession of the crime.”

It’s a long way down from these fears to the city of Boise trying to keep the homeless from creating public nuisances and dangers.

What cruel and unusual punishments were the plaintiffs found guilty of violating the Boise ordinances subjected to? Tarring and feathering? The rack? No, they were all sentenced to time served, with the exception of one of them, who was twice sentenced to one additional day in jail. One of the plaintiffs who pled guilty paid a $25 fine.

Nonetheless, the Ninth Circuit somehow invented a constitutional warrant to declare Boise guilty of a grievous violation of the Bill of Rights. According to the Ninth Circuit, such encampment laws now can’t be enforced so long as there are more homeless people than practically available shelter beds in any jurisdiction.

The ruling was a body blow to localities in the West where homelessness has been exploding. It isn’t as though these places are heartless. Cities have been devoting significant resources to shelter. They have also tried other tacks, from regional cooperation to homeless-outreach teams.

But stopping the blight of ­encampments should be a lowest-common-denominator priority of public order and safety — one that the Ninth Circuit has now made more difficult.

As a brief to the Supreme Court from California localities asks, what does “practically available” mean? Is shelter not practically available if it has a requirement or limitation inconvenient or unsuitable for someone? Does a city have to count how many homeless people it has on any given day to see if it can enforce its ordinances? For big, overwhelmed cities, like Los Angeles and Portland, it isn’t even a question.

Since the basis of the Ninth Circuit’s decision is that sleeping is a basic human need, it puts at risk other commonsense statutes. It is also a basic human need to defecate and urinate. A drug addict feels a need to use drugs. When will the Ninth Circuit, or some other adventurous court, find Eighth Amendment protection for these?

There is an obvious public interest in tearing down encampments and keeping them from springing up. They are dens of public-health risks, drug abuse and crime that significantly degrade the quality of life.

When Orange County cleared out a big encampment last year, it found more than 13,000 needles, 5,000 pounds of waste, including human waste, and 400 tons of ­debris. Workers at City Hall in Los Angeles have been exposed to trash and bodily fluids from nearby encampments, also ­responsible for a rodent-infestation at their building.

San Francisco is notorious for needles and human feces littering its streets.

A society that lacks the ability to prevent such blatant and revolting affronts to public order — degrading and dangerous even to their supposed beneficiaries — has lost something important. A society that tells itself that it is literally impermissible to use the law to discourage them has lost its mind.

Rich Lowry is editor of National Review and author of “The Case for Nationalism: How It Made Us Powerful, United and Free.”

Twitter: @RichLowry