A federal court upheld its previous ruling that cities cannot criminalize homeless people for sleeping outdoors if they have no adequate alternatives.

The 9th U.S. Circuit Court of Appeals, based in San Francisco, rejected a petition Monday for a rehearing from the city of Boise, Idaho, in the case of Martin v. Boise. The court essentially maintained its September 2018 ruling that prosecuting or otherwise punishing homeless people for sleeping on the street if they have nowhere else to go qualifies as “cruel and unusual punishment” and is unconstitutional.

The September ruling applied to all cities in the 9th Circuit’s jurisdiction, which encompasses western U.S. states including California, Washington, Oregon and more.

The case stems from a 2009 lawsuit filed on behalf of six homeless Boise residents that claimed the city’s citations under its “camping and disorderly conduct” ordinances violated the Eighth Amendment, which bars cruel and unusual punishment.

“The ordinances criminalizing sleeping in public places were never a viable solution to the homelessness problem,” Judge Marsha S. Berzon wrote in Monday’s opinion. “People with no place to live will sleep outside if they have no alternative.”

The judge added that putting people in jail was “both unconstitutional … and, in all likelihood, pointless.”

“The distressing homelessness problem ― distressing to the people with nowhere to live as well as to the rest of society ― has grown into a crisis for many reasons, among them the cost of housing,” she added, noting that the crisis has continued to grow despite cities’ ordinances prohibiting sleeping in public places.

Since the September ruling, several cities, including San Francisco and Sacramento, California, Portland, Oregon, and Olympia, Washington, have all stopped enforcing ordinances that criminalized homelessness, according to a spokesperson for the National Law Center for Homelessness, which filed the lawsuit in 2009.

Amid the nation’s affordable housing crisis, on a single day in January 2018, more than 500,000 people were homeless nationwide, according to a recent report from the Department of Housing and Urban Development ― and almost one-quarter of those people lived in California alone.

For example, about 7,500 homeless people live in San Francisco, including more than 4,300 who were unsheltered or living outdoors, per the latest count in 2017. But the city has only enough shelter beds for about 2,500 people, a recent release from the mayor’s office says.

“Our end goal isn’t to protect the right of homeless people to sleep on the streets. That’s not a real win for them or for us,” Eric Tars, legal director at the National Law Center for Homelessness, told HuffPost. “We win... when homeless people aren’t homeless, but in housing.”

While the court ruled again Monday that homeless people can’t be punished for sleeping outdoors if there are no alternatives, “our hope is that tomorrow, cities will begin to create those alternatives ― getting homeless people into housing,” Tars added.

The city of Boise has not decided whether to appeal the September ruling to the U.S. Supreme Court, city spokesman Mike Journee told the Idaho Statesman.