As per the Portuguese model, it’s not legalization, it’s decriminalization. And the reason why, unlike Portugal, we’d ruin it, is because we have such a terrible track record with our health systems; Americans are just too immature and self-centered.
It’s still possible to have your case handled in criminal courts in Portugal, but you have to be a hard core serial offender, stealing or robbing to get your fix, etc. Sharing needles and shooting up in plain view are also verboten. Before that, there are layers of help and counseling and rehabilitation you have to shrug off. Only after you are judged incorrigible do you face the possibility of jail time, and you are given a lot of rope.
To help facilitate all the above, the State allowed for free no questions asked needle exchange, and mental and physical health care and rehabilitation. Public restrooms are equipped with needle drop boxes, and special blue lights that make it hard to see your veins.
This is what it takes to combat the issue; it requires adult thinking and planning, and a mature constituency willing to help their fellow citizens without and personal reward or political gamesmanship attached. Here in the US we can’t even agree on pandemic face masks without politics getting in the way.