Let's remember that mental health care is not as easy as a magic pill. It can take months to stabilize someone. Someone with schizophrenia may have difficulty staying on a regimen. (The side effects are bad in many cases, and the drugs aren't a magic cure.) Some people would do best in a psychiatric ward more permanently, for example, but that's including housing.
Bipolar treatment can stop working and it can take months to get things readjusted.
Inversely, homelessness exacerbates mental illness in many ways, and stabilizing the housing situation goes a long way toward stabilizing the mental illness.
Here in Los Angeles the number of homeless who are severely mentally ill is incredibly high. It's quite common to see homeless people standing on street corners, yelling and screaming at non-existent antagonists, behaving bizarrely, urinating and defecating in broad daylight, and creating a general nuisance for everyone around them.
The same goes for seeing drug and alcohol use in public, especially in places like downtown LA and Venice Beach.
Seems to me that the homelessness isn't the problem, so much as a symptom of the underlying issues of addiction and mental illness, and unless people voluntarily seek treatment for those issues their situation is unlikely to change.
Whether the healthcare is available or not, the question is moot if you can't force people to go to rehab and take their meds.
In the past those with mental illness or disability were locked up in facilities with little support for reintegration into society. In many cases being committed was effectively a life sentence. There were also cases of abuse of the system where people were committed for rebelling against parents, homosexuality or political dissidence.
Deinstitutionalization was supposed to transition patients to community based care but it was never funded to the level that would have been needed to support the transition. Even in the US today mental health care is typically the bastard child of the US health care system with minimal coverage. A $50,000 dollar a year arthritis medication is covered but only a couple of days to stabilize a patient in a mental health crisis.
I'm not sure if community based care would have ever worked even with the right funding and that a lot of the addiction and mental health issues may be related to the lack of environments that support mental health. I'm pretty sure that the alternative from earlier in the century also isn't the right approach.
Rehab doesn't address the part where you come back to normal life. And all the old aches and pains start up and nothing seems worthwhile and there's little work...
Teaching the homeless to be COMPETENT nomads is a better strategy. Otherwise they're at the mercy of public officials and contractors who only see them as a flesh to money machine.
I doubt anyone will say that what Utah did here is bad, but you have to wonder what's preventing a more comprehensive solution (the answer is politics, but ideally you'd get a more specific answer).