I'm not sure that SF does have more of a mental health or addiction problem. It certainly is visible in SF, but other cities have worse statistics depending on what specifically you're measuring.
I'd say the reason it is more visible in SF is due to a combination of the density, walkability, and policies that don't hide the problem as much behind locked doors.
eg: https://drexel.edu/uhc/resources/briefs/BCHC%20Drug%20Overdo...
I'd say the reason it is more visible in SF is due to a combination of the density, walkability, and policies that don't hide the problem as much behind locked doors.