Although I do think cannabis was made illegal to stop its many uses, the medical use was decreasing around the time of prohibition. THC was not discovered until the 1960s so in the early 1900s cannabis tinctures had unreliable potency. THC could not be tested for (or CBD) so they could not standardize the active components easily. It lost favor to new single molecule drugs with the advent of the hypodermic needle.
But the entire oil-pharma empire was made upon breaking herbal medicine in general. But reductionist medicine was working really well at the time, with the discovery that vitamins (one molecule) could cure diseases like scurvey and rickets, or antibiotics could cure infections people just assumed single drugs would work for everything. And well the capitalists could patent those drugs and they they started making herbalism into "quackery"