Of course that's the compassionate solution, but compassion holds little weight in the libertarian idealist sociopathy of Silicon Valley. But even from a cost perspective housing is the only solution.
You can make homelessness illegal, but then you're just housing the homeless in prisons. If you're going to house people anyway, there are cheaper ways to do it than with a prison.
You can bus the homeless somewhere else, but there's a long history of other places bussing people back to SF. Given the homeless want to be in SF because of climate, opportunities, etc., the average is that they're more likely to end up there.
Unless there's something else I haven't thought of, that really only leaves housing.
Existing programs are intended to get people into a position where they can obtain housing, but these de facto don't work very well, because they attempt to get them other things before housing. Housing before a job works better than a job before housing. Housing before addiction treatment works better than addiction treatment before housing. None of the existing solutions are sustainable as long as the person isn't housed. It's unrealistic to expect someone to hold down a job or kick their addiction while living on the streets. Without housing, no auxiliary solution is sustainable.
So not only is the only solution to homelessness housing, but it's housing first.