My startup adventures have prompted many visits to San Fran and in turn I witnessed the plight of the homeless there. It does not exist on any scale like it does there whether it's in Baltimore or New York City where I lived a year after college.
There's not much you can do re: the homeless in San Francisco, but it bothers me and makes me feel bad.
Overall not a fan of San Francisco for a variety of reasons.
You're advocating for in-prisoning people who cannot afford or, for whatever reason, can't live in a home. That's really awful and lacking in empathy. That's almost like debtors prison.
The vast majority of these people will actually stay in a home if you provide one. The majority of them in SF, however, do not have access to any type of shelter because the existing shelters are far too overcrowded and any attempts at building new shelters get held up for years by people who don't want homeless people in their neighborhoods.
The solution to helping someone is providing them with healthcare (preventative is far cheaper than reactionary care for the tax payer) and providing them with a place to stay. Currently we don't really do either, especially in SF.
While housing prices are a little different, zoning is most certainly an issue as many would much prefer to stay in any type of housing. You suggest making it a requirement but I contest that as that wouldn't actually be constitutional and most of the homeless here would love a place to stay. In NYC there are TONS of places for the homeless to stay but in SF, many shelters will have lines out the door well into the night and into the morning. There just isn't much shelter for them here. Attempting to build new homeless housing is always faced with NIMBY opposition.