Society also can't really choose not to pay the cost. If they break stuff, it may have to be replaced. If they commit a crime, they have to be housed in prison (which is expensive). And if they require urgent medical attention, doctors won't refuse not to help them even if they can't recuperate the cost...
In San Francisco the situation is a bit different. Housing is more expensive, so 20K won't be enough, and homelessness in SF is a bit more of an economically issue, rather than a mainly psychological one.
And even if SF could save money, they would have a hard time creating such a program, for various political reasons. Also it would mean investing tons of money up front, without the cost reductions being easily visible afterwards.