Now everything else follows. We can ask -- why can't they managing their own affairs? If it's mental illness, then is it possible to treat that illness, and get them to a situation where they can manage their affairs? Same for drugs/alcohol, and other things. But this has to be the cornerstone: they lose autonomy and some civil rights until they can demonstrate that they are able to function as independent responsible adults that do not perform antisocial behavior in urban environments. The urban environment must be protected, and the homeless should not be left alone in the streets.
The problem is that we don't have either a legal system or a care system setup (think halfway houses) for that kind of clientele. And some of those halfway houses will require bars on the windows, because for some of the hardcore population, they will refuse the care process. But it must be mandatory, until they demonstrate that they can provide for their own needs and manage their life in a harmonious way with the rest of the urban population.
When I was last in SF, I was having a coffee on Columbus in North beach and saw a homeless man with no pants but a dirty blanket run into the middle of Columbus avenue and take a big dump on the street. Then he started waving his arms and screaming at the cars that were trying to get by him. As long as San Francisco tolerates that behavior and gives that person an option to refuse treatment, then things will just continue to get worse. And high rental prices have nothing to do with it -- there is simply no rent that a person like that could afford to pay, nor would there be any apartment that would accept them.