The latter was a big part of the deinstitutionalization movement throughout the 50s-80s; there were several Supreme Court decisions that made it more and more difficult for the state to involuntarily confine mentally ill people in psychiatric institutions. That same subset of people are now homeless and addicted to drugs.
And in terms of social safety nets, two developed countries at opposite ends of the world (Spain and Japan), both with unarguably better social support than the US, have higher poverty rates[0]. And in all but one of those developed countries with lower poverty rates than the US, the median person is poorer[1].
It's possible that the very poorest of the poor (the kind you might see strung out on a street in San Francisco or Philadelphia these days) are better off in those other countries, but clearly providing that level of support incurs a cost that is borne by the rest of society. I'm not making a judgment call here on which approach is better -- merely pointing out that there is never a free lunch when it comes to social policy.
Well, I take it back somewhat: there is a judgment call to be made on the way we "help" those very downtrodden today, where taxpayer money is spent on letting addicted people continue their addiction in the name of "compassion", all while ignoring the damage it does to everybody else that lives in those neighborhoods. Bring back the institutions if we must, but the current approach cannot be the right one.
[0]: https://data.oecd.org/inequality/poverty-rate.htm
[1]: https://en.wikipedia.org/wiki/Disposable_household_and_per_c...