Drugs don't have to have positive value to argue for them being legal.
For example, cheap distilled spirits have little or no redeeming value. But it would be more harmful to make that illegal than otherwise. Methamphetamine (Desoxyn) is used to treat obesety and ADHD, and similar treatments for ADHD have similar potential for recreational use/abuse. But the whole Drug War is so harmful, it doesn't matter if there are therapeutic or harmless recreational uses of a drug. It would be less expensive, more effective, and more compassionate to treat addicts than to continue the Drug War, even if more people became addicted.
Sorry for being a bit off-topic, but re: heroin for palliative care, I was reminded of The Barbarian Invasions. Just a movie rec for you HN'ers, it's really great (IMHO).
Yes... there certainly is much medicinal value from cocaine and heroin. Which is why they were initially developed... for medical uses.
In addition, one might argue they pick a person up when they want to be up and relax them when they need to relax and abuse, not use is the problem. I'm not saying this argument is correct, but these drugs, like other drugs, have their uses. Which is why people use them.