Rich people don't want to live in your 100 year old apartment with 50 year old finishes. Unfortunately, in San Francisco, they don't have any other choice.
(Technically, they've only enforced price controls which make made profitable renovation illegal, but it has the same effect.)
Why would that be?
Surely many developers would have made the bet anyway, at least in 2010-2019, but going forward it'll be worth considering whether building housing for people who are likely to leave en masse is worth the risk.
People are building houses in countries where they sell at 20x lower prices.
Unless construction workers in SV are paid 1 million $ / year, the reason for not building is not that it's not (hugely) profitable.