SF is hardly starved for cash; its budget is around $12 billion, something like $15K per capita. That’s a huge amount of money.
Not to mention San Francisco has a massive pension liability in excess of $6 billion. The city really is bankrupt.
And during the longest economic expansion in US history the city has done virtually nothing to shore up its finances. Not like San Fran is alone in that regard.
For comparison NYC has a budget per resident of ~$9,500. But don't let that fool you into think NYC has it figured out. The city is nearly $200 billion in debt and will probably go bankrupt if there is another big recession.