Why? Well, there's rent control, and there are laws that make it hard to be a landlord, and there is a powerful Tenant's Union.
Even some progressives are noticing the problem:
“Vacancy rates are going up because owners have decided to take their units off the market,” said Ross Mirkarimi, a progressive member of the Board of Supervisors. He attributes that response to “peaking frustrations in dealing with the range of laws that protect tenants in San Francisco that make it difficult for small property owners to thrive.”When you make it hazardous to provide a service,
the supply goes down as providers get nervous.