Yup - I think it's very important to point out that there are two different problems to solve here.
1) What sort of behaviors is a community willing to tolerate
2) What does that community do with people who are unable to stay within the confines of tolerated behavior
The problem is that asymmetrical answers to the two questions can create a strange grey-zone, where problems linger.
For example - if you murder someone, I don't think many people are going to argue against you spending some time in prison. The response is in line with the severity of the action.
But... if you say, consistently piss in the elevators of your local metro (even though public bathrooms are available), most folks aren't sure prison is the right answer. Ideally - we'd just keep you out of the metro entirely - but setting up that system is very expensive when we're dealing with a very small number of bad actors.
On the flip side - that small number of bad actors is doing considerable damage long term. They're making metro usage far less pleasant, driving down ridership, increasing cleaning costs, reducing public health, and requiring additional staff in attempts at monitoring. Each other member of society is only inconvenienced a relatively minor amount, but they're impacting a very large number of them by degrading a public and shared service.
The same is true of those who camp/sleep outside of businesses, or scream & rant in public spaces, or do drugs in public spaces. They are actively harming the space they are using at large, and are unwilling to stop or unable regulate themselves.
So what do we do with those people? What is a proportional action that we can take that prevents the damage this person is causing at scale?
Prison/Jail rarely work - because the damage of each individual occurrence is small, they are usually out very quickly.
Providing housing can resolve problems in some cases, but there are people who are actively unwilling to stay in publicly provided housing (for a variety of reasons - although the most common I see is consistent drug use, closely followed by serious mental illness).
Meds can definitely help - but the category of people creating these disturbances generally have trouble consistently taking meds (again - for a variety of reasons including access to services and payment, but not the least is active, personal resistance)
So... if we've ruled out (as in - tried and failed) self medication + housing + prison... where do we go?
Because at that point - I'm not really convinced that forced treatment and care are really unreasonable responses. It is far more cost effective to gather these folks in a single place and confine them there than it is to allow them to roam and attempt to stop their problem behavior at the place it occurs. It's the difference between 10 guards, a large facility home, and medical staff - versus thousands of required staff spread over a city.