No city can adequately fund these programs, and San Francisco certainly doesn't build housing for the homeless, have an enlightened drugs policy or have adequate mental health care. San Francisco and other coastal cities mainly differentiate their policies by treating the homeless populations there with malignant neglect instead of outright hostility, which leads to the phenomenon you see where 10-12 cities bear the brunt of a national homelessness crisis. Because San Francisco is one of them, you also see a bunch of entitled tech bros whining about how they have to see a homeless person sometimes on HN.
I will admit that, by American standards, SF has pretty good public transit though.