Cities exist as job markets. And the primary force that keeps urban areas safe and friendly is the shoeleather of middle class workers coming in and out of work each day.
The vacuum left has been filled with homelessness and poverty. These people were always here, but there was enough critical mass that they were at the margins. Now they are at all of the bus stops and train platforms.
Cities often had their priorities backwards and became very dependent on unsustainably high property values. Even if you started rezoning office buildings into housing, SF would be taking a double hit - there is less reason to live in SF and more housing would bring down values everywhere. Forgetting that these business districts are pretty undesirable places to live anyway.
So we are looking at a potential "death spiral" as cities lose their appeal, and lose the funding to solve the problems. Until they button up and find a new stable equilibrium.
SF is especially weird because it had/has somewhat of a vibrant tourism scene, and was always pretty hostile to its own business community. And now you have a hollowed-out downtown that is now not nearly as desirable for business and not particularly tourist friendly either.