No one is a criminal in my eyes for just doing whatever drugs they do. You are, however, a criminal if you run around chasing people on the streets with an axe, screaming at them, and then steal a car[0] (I am aware that this is Seattle, not SF, but the point still stands).
And I honestly don't think that officially legalizing fentanyl or meth or whatever else they were on would have helped, especially since drug consumption crimes are de-facto non-enforced in Seattle (which imo is not a bad thing at all, I am totally fine with consumption not being a crime).
0. https://komonews.com/news/local/axe-wielding-man-apparently-...
The key here is probably the 'depending on the environment' bit. Hashish used to be closely associated with political assassinations, now... not so much. But it could be again, given the right(?) culture.
Not all drugs are equal. You can't drink your way into effectively schizophrenia, but you can get there in no time with the currently available super-potent variety of meth. Some drugs completely wreck your ability to live in a way compatible with holding down a job, which means that you'll pretty quickly have to turn to crime if you want to keep doing them.
What's worked very well in other nations is to literally supply people with as many drugs as they'd like.
The government handles the manufacture and distribution. All of it for free. In return:
1. The government knows who and how many drug users there are
2. Rehabilitation services can be provided. They may even be a requirement for someone to obtain the drugs.
3. Addicts can begin to lead a much more stable life due to a consistent supply. This has positive impacts on the society for many obvious reasons (e.g. little incentive for crime)
4. It is much easier for someone to ween off a drug if quality/supply is consistent.