>Or if they're homeless due to mental illness get them admitted.

Therein lies the problem. A large proportion of homeless fall into this category [*], and it's very hard to institutionalize people against their will. We like to think that most homeless are functional people who are simply down on their luck, and thus putting them in stable housing and getting them set up to work would solve their problems. But this is sadly not the case.

[*] This study [0] found that 80% of homeless people have some kind of mental illness, with 30% having severe mental illness. This is compounded by the fact that >50% have substance abuse problems.

[0] https://pmc.ncbi.nlm.nih.gov/articles/PMC8423293/

Right. As I touched on elsewhere in the thread, our local jailers know all the homeless people in town because they show up regularly when their mental illnesses and/or substance abuse get them into trouble. The ordinary guy who wound up homeless due to a string of bad luck and just needs a place to sleep and a new job to get back on his feet is more a movie trope than reality. These are people with real problems who in many cases need regular supervision in something like a group home, if not outright institutionalization. And as you said, the latter is very hard to do now.