Having seen how places like Chicago treat the homeless in the interests of keeping the things you're pointing out hidden from sight - I appreciate SF's more tolerant, somewhat live-and-let-live methods, in lieu of better, more compassionate solutions.
Hopefully having all this on display in SF will eventually provide enough impetus for the better solutions to emerge. Until then, I hope they don't decide to start being agressive and violent towards what is a largely mentally ill and incredibly vulnerable homeless population.
My admittedly limited understanding is that much of this problem is the result of mental institutions being closed across the state in the face of federal funding vanishing in the 80s. [1]
I've also heard numerous anecdotes about mentally ill patients and the homeless being forcefully bussed to San Francisco from not just other parts of California but other states, precisely because of the city's tolerance. If there's a shred of truth to this, it's a trivial to see why it's such a persistent problem.
[1] http://sfist.com/2016/06/27/san_francisco_homeless_history_1...