Ontae Butler, 24, outside the Anacostia Metro Station in Washington D.C., on Aug. 20. Mr. Butler was interviewed by a representative from Sasha Bruce Youthwork, which is conducting a census of homeless teens. (Allison Shelley/For The Washington Post)

JAILING HOMELESS people for sleeping outside might seem harsh or unwarranted, but according to the Justice Department, it’s also cruel and unusual punishment — an unconstitutional infringement on their Eighth Amendment rights.

The department has said as much in a Boise, Idaho, court case challenging a law that criminalizes sleeping or camping in a public space. The Justice Department argues that barring people from sleeping in public when there are not enough shelter beds for them essentially bars them from sleeping at all. The department hopes to use its legal leverage to prod municipalities into providing more emergency shelter and other services for homeless people.

The Justice Department is correct that criminalizing behavior associated with homelessness is no solution. Admittedly, a concentrated homeless population can create a public nuisance or health hazard, but the fact that many people simply have nowhere else to go must be addressed. In some major cities, overnight housing for homeless people can serve only half the need. In others, the numbers are even worse.

With homelessness rates rising, many cities have made it illegal to camp, sleep, lie down or even sit in public places. They hope to drive those who live on the streets out of town. Such laws fail not only a moral test but also a practical one: They tend not to work. Instead of encouraging homeless people to find jobs or homes, criminal citations make it harder for them to do either. What’s more, studies have shown that ticketing, trying and jailing the homeless is pricier than providing them housing and caseworkers.

All that said, we would urge judges to exercise caution before attempting to establish a constitutional right to housing. The implications of such a finding would be unpredictable and certainly far-reaching. No city should be in the business of shipping its problems — or its homeless — to neighboring jurisdictions. But municipalities should have some leeway to find local answers to a local problem.