In other circumstances I'd accuse that of deterring investment and being a contributor to the terrible housing situation in the Bay Area in general, but honestly, the zoning / planning-permit situation is the first limiting factor.
Indeed, let's all shed a tear for the SF landlord. I don't know how those poor folks can stay in business when property taxes are capped and median rent rises at ten times the rate of inflation!
Considering that any landlord buying a property will certainly be on the hook for the downside in a property if the housing market crashed, and you'll see that this isn't the greatest. (BUT THE HOUSING MARKET ONLY GOES UP AND WILL NEVER CRASH hahahahahaha yeah right).
Anyway. In general one needn't shed a tear for landlords and capitalists of their ilk for failure to make a profit: the money is its own reward. But we do need to respect the money (because that is the reward), the precise behaviors we are incentivizing, and the impact of political risk which we are inflict upon the people we might want to spend money investing in the region. For instance: making things like this risky means that risk-tolerant entities are likely to be involved (which means the rich guys, speculators and businesses that San Francisco loves, not individual homeowners). And the price of the landlord assuming any political risk will find itself baked into the price of any new rental property.
But as I was saying: it's kinda moot from a median-apartment-price perspective if nothing new gets built anyway for other reasons.
About 72% of SF's units are under rent control. So not all landlords are making "fat profit margins".