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.