The original drug prohibitions had a moral rationale rather than a practical one. It began with the American prohibition of opium, which was primarily motivated by a moral objection to white people smoking in Chinese-run opium dens. This began a prohibition movement in the United States. In 1913, marijuana — which was used almost exclusively by Mexican and Indian immigrants — was prohibited for the first time by the state of California.
Today, when new drugs are added to the long list of illegal substances, it is because they are judged to be “addictive”, not because they are harmful. The United States’ Controlled Substances Act calls for a drug to be prohibited if it has “a high potential for abuse” and if it “may lead to severe psychological or physical dependence”.
The drug does not have to be harmful in any other sense. According to US government statistics, paracetamol (acetaminophen) is involved in nearly five times as many emergency room visits as MDMA (methylenedioxymethamphetamine, often referred to as “ecstasy”), and it remains available in supermarkets around the world.
So the main reason that drugs like alcohol and caffeine are legal, but cocaine and MDMA are not, is that the latter are judged to be “addictive”. (Suspend for a moment the true belief that alcohol and caffeine are addictive.)
Addiction does harm the addict, to be sure. But self-harm cannot provide grounds for prohibiting a substance. As philosopher John Stuart Mill famously put it, the sole legitimate reason for interfering with a person’s liberty is when he risks harming others.