Why do you think so? What makes SF have so many more drug addicted or mentally ill people, compared to cities with sane housing prices?
Here's a study someone else posted: https://news.ycombinator.com/item?id=33010913
"The data shows that over 70% of all of SF's unhoused people became homeless while living in San Francisco"
According to a 2019 survey [0], only 70% of people were living in SF prior to being homeless, and of those 70%, approximately half had lived in SF for less than ten years.
To me, that's staggering if 30% of the homeless population was already homeless before they moved to SF, and if another 30% became homeless within 10 years of moving to SF.
[0] https://en.wikipedia.org/wiki/Homelessness_in_the_San_Franci...