But the citizens of SF can just stop electing local governments that fund this, yet they don't. I can certainly see how they contributed to causing the crisis (i.e. by electing people who caused it), but I don't see how they profit from it, unless the people in SF likes such conditions, which seems pretty weird, at least to me.
Exactly. The residents could vote to build more shelters or do something/anything realistic to solve the homeless issue (other than just giving them money/tents/needles), but if they build more homes then that increases the supply of homes which residents are fundamentally against. They don't want any new housing to ever be approved for any levels/neighborhoods because by restricting supply it pushes prices up.