No idea about San Francisco but the amount of homeless people in Hawaii is mental and a lot of these people do seem to have drug or mental health issues. Reason I'm bringing this up is that we were told that a lot of other States dump these guys in Hawaii and pay to FLY them there. We thought that was made up but upon reading that they dump people in California, who knows.
As a side note, surprised to read about Glasgow. I walk between Queen St and Central station most mornings and see dozens of people begging and sleeping rough every day.