I lurk in this thread a lot and read just about every post but in this case feel compelled to add to the discussion. Homelessness is rarely caused by mental health alone, and in any case that it is there should be state support to help with rehabilitation that involves providing a house. I say this as someone who has previously struggled and been diagnosed with serious mental health issues, and as someone who is ex-homeless.
While homeless I slept rough the majority of the time but also stayed in shelters, when I begged for enough money to be able to afford to. During this period I therefore also spoke with a wide number of homeless people, as the only people willing to converse with the homeless are the homeless themselves. As I was in the same position as them, I heard a lot of honest life stories and the reason why many of them became homeless. Though serious mental health problems may play a part sometimes, there is always deeper cause behind those problems that causes the homelessness itself.
For instance, one lady became homeless because of panic disorder: she couldn't claim benefits (welfare) because it either involves using the internet which she didn't have access to, or going to the council offices and doing it in person, which she found herself unable to do due to panic attacks preventing her from doing so. That meant that when she didn't reapply for benefits they pulled the rug from beneath her, and she was evicted by her landlord because she didn't have any money to pay rent. This lady should have been eligible for not just housing benefit but disability benefit to secure a decent level of quality of life for herself, yet fell through the cracks and became homeless for no reason more than policy and bureaucracy. Perhaps counter-intuitively being homeless has helped her with her mental health issues since in a way it's a sort of shock therapy, which is something that I found too. However, once you become homeless, you're homeless for life unless you manage to panhandle enough money to put a deposit on a house, since in this country in order to get a job you need an address.
One man who I've become actual friends with and still see from time to time is homeless because his wife and 2 year old daughter died in a car crash. He became victim to severe depression and unfortunately turned to drugs (heroin), which led to him being fired from his job as a builder. When he sought help from the NHS for his mental health they told him that they don't have the resources to treat people who are taking ""recreational"" drugs, since they would interact badly with whatever anti-depressants they would give him, and that he first needs to prove he can stay clean, while providing him no support in said endeavour. Eventually his drug habit cost more than his unemployment benefit and he was also evicted from his house for not paying rent.
That's not to say that this is an absolute rule. I've met homeless people who are in perfectly good mental health and who simply enjoy living freely and on their own terms. They don't need a job to pay rent because their shelter is a caravan or a tent, and they prefer it that way. Though it's not a mindset I ascribe to, I see no reason to criminalise this. Are they a danger to themself or others by choosing this lifestyle? No, not at all. The purpose of punitive law is to protect a state's citizens, and so if they're not endangering anyone, the law that's in place is not serving the correct purpose.
Of course there's also the question of correlation or causation, and though I would wager more often than not the mental health issues precede the homelessness, I don't think that's evidence enough to say that it causes said homelessness. To make that statement implies that people with serious mental health issues that impact their lives significantly enough to restrict their social contribution should be homeless, and to me that's flat out incorrect. If that were the case I would have been born on the streets; my Mum has never worked a day in her life due to her mental health (and later physical) as a result of PTSD originating from sexual exploitation she endured for several years as a child. However, because we live in the UK she receives disability benefit and housing benefit that means not only is her rent paid but she had enough money to also support raising 2 children -- with the bare minimum, but still sufficiently. As far as I can tell, this is different to America. If my Mum were in America, she would not be eligible for any welfare because you need a formal diagnosis from a doctor, and to get that diagnosis costs money that she would never be able to get without a job. Really I'd like a democratic candidate to say "yes, I'll decriminalise homelessness, but I'll also try to prevent as much of it as possible", because with a few overhauls to the US welfare system I believe a lot of people and families who are currently living in vans could be staying in the homes that they deserve. The UK welfare system is generally still horrendous and many people who need money go without it, but it's significantly better than the US', and I attribute the UK's far better homelessness rate to our welfare state.
With all that said, I'm fortunate to be typing this in the UK. Homelessness isn't criminalised here -- homeless people still get no support from just about anyone in actually getting off the streets, but it's not something you can be thrown in jail for. Not even panhandling is illegal here. Honestly, this thread is the first time I've been told that it is illegal in America, and the entire notion is just baffling. Through research I see that only "aggressive panhandling" is a crime and non-aggressive panhandling is apparently OK, but when sitting on the street with a sign and a cup is considered to be aggressive, and that's the most passive form of begging possible, clearly the distinction is fictitious. Scrolling through any political theory I've studied in my mind, I honestly cannot think of one notable figure in history who would support this law. There are plenty who would vilify or ostracise homeless people, but none that would criminalise them. I feel despair that America has got to such an indomitably social darwinist point that it's regressed past allowing poor people to die to encouraging them to.
tl;dr Mental health is very rarely the sole cause of homelessness, and people with serious mental health issues can still live ordinary lives. More often than not, neglecting people with serious mental health issues causes homelessness, and that's something that America can do something about. The spread of serious mental health issues can be limited, and victims who currently have it can be cured. The very first step to accomplish that is, naturally, to decriminalise homelessness (it's baffling that it's currently criminalised), and from there it's to actually have a functional welfare state. Also, medicaid for all.