A most common theory is that polices make more money enforcing anti narcotics laws than enforcing other laws. They can demand $100k as bribe every time they caught somebody.
But that's in corrupt states like Indonesia.
Cops don't make money capturing people.
What incentives politicians in US have in prohibiting xtc, mdma, ganja, dmt, and so many other safe drugs?
Even if some people actually think those drugs are dangerous, can't people see that almost no body die from it? Are people too bad at statistic that they can't see that far more people die from peanut alergy and cigaretes than ganja?
There are a few reasons that drug law is enforced in the united states, but can be boiled down to bullet points.
There is a large* group that believes that drugs or immoral, and that group significantly intersects with the group that believes Morality should be legalized.
There is a reasonable amount of evidence that Drugs in a city causes** gang wars, murder, prostitution, etc, etc. Most people don't want that in their city, so they don't think drugs should be legal, reguardless of what they think of the use of drugs in a vacuum (assume a spherical bong)
Some people believe that non-harmful drugs (marijuana, kratom, etc) are lobbied against by pharmaceutical companies. Essentially, as these drugs are produced by naturally grown compounds (instead of in a lab) they are easy to create and represent a threat to the interests of big-pharma. By using these drugs for pain management, the more expensive products aren't as desirable, ergo big-pharma loses money.
Finally, some drugs are very harmful. Heroin, Crack Cocaine, percocet; all of these drugs can lead to lethal or debilitating overdoses, and quite easily. There is a segment of the population that believes these should be legislated against to protect drug users from themselves -- If it's harder to get a drug, it's hard to overdose one.
*Take large with a grain of salt -- This group has enough sway to elect legislatures who will agree with them, but that's the most I'd say about it
**While some drugs may cause homelessness and prostitution, the murder and gang wars are generally gangs trying to claim exclusivity over a market area to sell drugs. If the drugs weren't illegal and could be purchased through legal retailers, gangs wouldn't fight over selling them
I can tell much about the issue in my country. However, I do not know if the same issue happens or not in US.
Most criminals in Indonesia are drug related crime. Drug is the most illegal things in US. My friend told me that you can do anything in Indonesia, even murder people, but don't do drugs ever.
Drugs, soft drugs, like xtc, meth, ganja, are freely available though. Everybody knows how to get it. Namely in most clubs in central Jakarta. Everybody knows that cops are paid to look the other way around.
This give some perverted incentives for cops. Cops that shoot down pickpockets and robbers go to jail. Cops that arrest drug users can demand $100k bribe.
Most people in Indonesia consider drug as "evil". There are huge population support in favor of death penalty for drug smugglers.
Back to questions. Why would legislators prohibit drugs?
If drugs were legal, whether it's taxed or not, the cops would not get money anymore. I am pretty sure the cops would put some good words for legislators to criminalize it. It's a very simple, very obvious motives.
Government here wants to control anything with high economic value. Every trade with high economic value is controlled in one way or another.
So not just drugs. Someone get caught for buying from farmers and selling chili to factories. The people just buy it because they think that the act would "stabilize prize". Prostitution is also controlled. Almost all massage parlor provides extra service.
In fact, it happens again and again and again in all sort of area of life. Cops would arrest a shop for selling without "license". Then another soap factories will be screwed for "not" having licenses. Then some merchants are arrested for "disrupting" price because the merchant engage in "unhealthy competition".
All those "criminals" are extortable. Cops that arrest them are rich. Cops that arrest real criminals got nothing.
Basically most cops here do not go after thieves, burglars or robbers. They aim for good people selling anything and find mistakes. Rules are unclear so anyone is guilty of something.
So I think that's the motive of why narcotics are illegal in Indonesia. However, I do not see how this extend to countries with less corruption. Narcotic is also illegal in Singapore and US. And that includes narcotics with minimum danger.