I think you need to balance the risks of addiction and negative health consequences against the cost of having gangs/cartels profiting off of the fact that the substance is controlled. With marijuana, it is neither very addictive nor are the health consequences of using marijuana very severe, at least in the short term. Legalization is a bit of a no brainer for marijuana.
Opioids are at the other end of the spectrum - they are highly addictive and aside from the possibility of accidental overdose, even just using them at the correct dosage carries a lot of negative health consequences. It is not clear that you get a net win for society by legalizing opioids.