I don't doubt that opioids have contributed, but alcohol and other legal drugs are a major problem too. If this ruling is based on government caused harm, then it would require investigating the availability of alcohol due to policy too.
You can count the number of people on the street, maybe 1 in 15 has an alcoholic beverage, the rest are smoking meth/fenty/heroin.
SF's problems are all about drugs.
It seems alcohol is still the most abused substance in the homeless population. https://pubmed.ncbi.nlm.nih.gov/29852450/
This is basically what you'll see every few feet in San Francisco's Tenderloin district:
https://twitter.com/DTenderloine/status/1382405311009488897
(Warning, extremely graphic)
Alcohol is certainly abused, but not as publicly as Heroin/Fentanyl....
Alcohol and "legal drugs" are not the problem.