Communities across the country are struggling with policy solutions to address homeless encampments, and San Francisco is no exception. With a wildly unaffordable housing market, and thousands of people living unsheltered in the city’s public places, San Francisco lawmakers are under significant pressure to act. But turning to law enforcement to criminally punish homeless people for their involuntary presence in public is not the solution. Indeed, the misguided proposed tent ban offered by Supervisor Mark Farrell ultimately will worsen the problem of homelessness — and waste precious taxpayer dollars in the process.

In April, 11 homeless people sued the city of Eureka to stop the planned eviction of a local homeless encampment where they are living. The federal court agreed with them, stopping the city from enforcing its anticamping law, saying such action would be unconstitutional. The court reasoned that because homeless people outnumber available shelter beds in Eureka (as they do in San Francisco), there is literally nowhere for them to live or sleep except outdoor public space.

Because humans must sleep, and because these individuals have nowhere else to go, the court ruled that punishing them for camping is unconstitutional under the Eighth Amendment. Similar challenges have been raised around the country where homeless people outnumber available shelter options.

The federal government has also weighed in on the constitutionality of laws prohibiting homeless people from sleeping in public. Last year, the Department of Justice filed a statement of interest brief in a lawsuit challenging a camping ban in Boise, Idaho, asserting that criminally punishing homeless people for carrying out life-sustaining conduct in public is unconstitutional.

This position was underscored in subsequent remarks made by Attorney General Loretta Lynch at a recent White House convening on incarceration and poverty, and again in a Department of Justice community policing newsletter dedicated to the criminalization of homelessness.

Beyond constitutional concerns, the federal government has repeatedly condemned the criminalization of homelessness as ineffective and expensive public policy. For example, the U.S. Interagency Council on Homelessness stated in its recent guidance on encampments: “The forced dispersal of people from encampment settings is not an appropriate solution or strategy, accomplishes nothing toward the goal of linking people to permanent housing opportunities, and can make it more difficult to provide such lasting solutions to people who have been sleeping and living in the encampment.”

The federal government has also altered at least one critical funding stream — the nearly $2 billion in federal funds awarded to communities for homeless services — to prioritize funding for communities that have reduced or eliminated the criminalization of homelessness.

The tent ban placed on the November ballot by Farrell is precisely the kind of criminalization policy that the federal government aims to end and that have been unsuccessfully tried around the country to no benefit. Rather than promote public safety or open sidewalks as claimed, these laws harm communities by wasting millions in taxpayer dollars. Indeed, data from San Francisco’s budget office shows that the city spent in 2015 more than $20 million on enforcement of its long list of existing laws criminalizing homelessness, with no apparent reduction in homelessness.

In a city with thousands fewer shelter beds than homeless people, even policies that require an offer of one night of shelter before an arrest — a provision touted as an improvement over the current practice — will fail to reduce homelessness. Instead of bringing the housing and shelter options to scale, these policies simply redirect limited resources from one person in favor of another, and displace homeless encampments from one public area to the next — a practice aptly called by homeless organizers the “sidewalk shuffle.”

In the end, only one solution will sustainably end homelessness, and that is housing. A growing body of research has shown that housing is not only more effective at ending homelessness, but it is also cheaper than criminalizing it. When the solution costs less than the problem, common sense dictates how public money should be invested.

By bringing to scale permanent supportive housing programs, expanding access to housing subsidies, and removing barriers to affordable rental housing, San Francisco can realize reductions in homelessness that will never be achieved by treating the housing crisis as a criminal justice problem.

Tristia Bauman is a senior attorney with the National Law Center on Homelessness and Poverty.