Giving a home to the homeless will also help their mental health

People who are homeless experience much higher levels of mental ill-health than the general population and mental ill-health is often an input as well as an output of homelessness.
In other words untreated mental illness can often be a causative factor of homelessness, particularly when combined with drug or alcohol addiction.