Last month, the downtown San Diego franchise of the Burgerim restaurant chain closed its doors, contending that chaotic conditions caused by large numbers of homeless people in and around nearby Horton Plaza Park had driven customers away and made it impossible to operate. The shuttering of the Burgerim location was a warning signal to the San Diego business community — and to city hall, too.

Burgerim would not be leaving quietly. The franchisee, backed by parent company Burgerim USA, intended to sue in state court, claiming that neither its landlord nor the city of San Diego had lived up to their responsibilities to keep the city’s historic Gaslamp Quarter clean and suitable for business.

Burgerim’s legal action will be of special interest to members of the multibillion-dollar homelessness industry nationwide. Despite the many billions spent on homelessness, however, the problem is getting worse, especially in California.

Along with homeless encampments come deadly outbreaks of hepatitis A, typhus and other communicable diseases, driven by attending drug addiction. Some parts of the city are littered with syringes. A desperate San Diego now steam cleans its streets and sidewalks.

Even in expensive neighborhoods, unguarded greenery is often strewn with trash and toilet paper, revealing where homeless people have spent the night. The city tries to keep the squalor at bay with improved shelter programs.

It even plans to provide 500 bins where the homeless can stash their belongings, but that effort alone will cost the city about $2 million a year in overtime for the cops who guard the lockers.

Will Burgerim’s lawsuit have any effect on this complex, expensive and apparently intractable social issue? Can retail and restaurant tenants really use the courts to force landlords and municipal governments to protect them against a problem no one seems able to solve?

Absolutely, says Niv Davidovich, a lawyer for Burgerim. “There is ample case law that will allow the Burgerim lawsuit to move forward,” he maintains. “Landlords and owners are responsible for reasonably maintaining the common areas of any commercial property.”

Whatever the fate of Burgerim’s lawsuit, it’s difficult to foresee how legal action will affect the homelessness crisis long term. If held liable for problems caused by people over whom they have no control, private landlords at least have the option of going out of business — a nightmare scenario that has already destroyed large sections of urban America. But what about municipal government? Can the law force cities to end or control homelessness?

For decades it’s been an open secret that “homeless” is, for the most part, a euphemism for chronic afflictions that have proven very difficult to treat. The overwhelming majority of homeless people end up on the streets either because they are mentally ill, or because they engage in self-destructive behaviors, or because they live in a cruelly compassionate “non-judgmental” society that no ­longer grants itself the moral authority to distinguish between illness and health.

In the mid-1980s, when I worked in New York’s City Hall, Mayor Ed Koch commissioned a detailed study of the city’s single homeless men. I no longer have the report, but I recall its main conclusions, which divided this population into five main groups.

A large segment was clinically diagnosed as seriously mentally ill. A smaller group suffered from severe personality disorders. They weren’t necessarily sick, but they had a hard time interacting with others.

Another 20 percent of the persistently homeless were crippled by substance abuse (though men in all five groups used drugs and alcohol to some extent). Hardcore slackers — what we used to call “bums” — made up about 15 percent of the total. They were generally healthy, and often had job skills, but preferred not to be tied down to regular jobs.

The remaining segment — roughly 10 percent of the homeless — were simply down on their luck. They had lost a job, they had been burned out of their apartment building or they had seen a marriage break up. They needed a helping hand to get back on their feet.

The report concluded that only this last 10 percent of the homeless population could be helped in any meaningful way, an observation that sheds light on why, despite billions in spending and hundreds of social programs, homelessness and the chaos it creates has reached the crisis point in cities and states across the country.

Clark Whelton was a speechwriter for Mayors Ed Koch and Rudy Giuliani. Adapted from the Manhattan Institute’s City Journal.