The real reasons for the housing crisis and massive inequality in San Francisco are:
(1) ZONING. Basically, it's illegal to build apartment buildings in California. The new Mayor of San Francisco (London Breed) has pledged to change this.... but for now, it's still illegal.
The ban on new housing creates homelessness, prevents most people from getting ahead (because all their money goes to try to find housing, and probably to transportation since their housing is so far away from their jobs), and massively increases the wealth of the "old money" who already have housing.
Nice long article digging into this. It's 4 years old, you have no excuse for not having read it.
How Burrowing Owls Lead To Vomiting Anarchists (Or SF’s Housing Crisis Explained)
Too hard to read? It's also a comic book!
Burrowing Owls, Vomiting Anarchists & SF Housing: The Comic
(2)...exacerbated by Proposition 13, which again benefits the "established" and hurts anyone new, by letting "oldsters" and corporations pay far lower taxes than newbies.
(3) Your nice climate. When people are homeless, if they have a choice of California, Arizona, or Minnesota, in Arizona they will die of heatstroke, and in Minnesota they will freeze to death, but in California they will live.