The logic, whether or not you agree with it, is that drugs in general are hazardous and can kill or disable you, and they contribute to a black market and all the related crimes of drug trafficking and addiction. So punishments aren’t for drug use but for possession and trafficking.
Edit: to all the downvoters, I’m not advocating for draconian drug laws, I’m just answering OP’s question on why cops and lawmakers have such a policy and the logic behind it.
drugs in general are hazardous
Not true in general, and certainly not true in specific cases. There are over 16,000 drugs used by humans, and very few of them are hazardous at the correct dose. Are they hazardous at incorrect dosage? Some are, some are not, but then almost anything, water included, will kill you at inappropriate dosage. Many illegal recreational drugs such as LSD, psilocybin and DMT have no known lethal dose.
they contribute to a black market and all the related crimes of drug trafficking
That’s simply a function of them being illegal. If they were not illegal, they would not “contribute to a black market and all the related crimes of drug trafficking”.