If you read up on Oxycontin, it was formulated and prescribed in a particular way that created many addicts[1]. In particular it was claimed to work for 12 hours when in some people worked for much less. Being on an opiate for pain and then having it wear off and being forced to wait in pain for sometime before taking it again, is a recipe for creating addiction. Many people also were less wary of taking the opiates when prescribed by their doctors.
I'm not sure if the opiate overdoes epidemic is a clear strike against legalization, but it is surely a cautionary tale about supporting a system of all drugs being open sale of unlimited quantities and unlimited advertising. I support some form of drug legalization but, unlike food that is controlled for content but not much else, legal drugs will need more regulation.