It's kinda both. In NZ in the 90s, residential care for people with severe mental illness was replaced with "community care" where all those patients be helped to go flatting the community, and have their condition treated so well that there was no need for residential care facilities.
It's far better! It's more respectful! It's also incidentally going to let us trim millions from the Health budget so we can pay for the tax cuts for high earners!
The care provided in the community was wisely delegated to the Almighty Invisible Hand of the Free Market, so a bunch of fly-by-night sub-par contractors sprung up to get the government cash and then provide very little care at all, and so large numbers of former patients ended up homeless due to their poorly controlled illness, and well gosh, hard to care for them in the community when you don't know where they live right?
It's an absolute debacle, and a great demonstration that neoliberalism is nothing more a belief set for business people who don't like paying tax.
But I fully agree that homelessness is a great medium for developing mental illness and drug dependencies.