Yes, Harry Anslinger's credulous horror stories helped to achieve his own job upgrade, but several factors were in play, an outline of which follows...
Prohibition ended, and its prosecutors and beneficiaries felt an organizational need to replace the rehabilitated demon liquor with a new seemingly more dreadful hobgoblin. Cannabis, cocaine, opiods, et al were drafted in these roles, and equipped with retconned backstories featuring enough racism, special pleading, exaggeration, and propaganda to offset their former relatively neutral herbalist and pharmaceutical reputations.
A flip-side of the question is whether or not the political interests of organized crime were equally well-served, and on board with the criminalizing. Considerable criminal fortunes were made in 20th century America black-marketing contraband drugs, and portions of those fortunes were used to exert political influence in the form of bribes, blackmail and sponsorship. SFAIK no magnate of contraband has ever lobbied for legalization.
Radio broadcasting, (and later TV), helped to rapidly spread the word, as well as federally compliant (cooperative even) media ownership. Presumably the feds found other ways to help those owners in return. Broadcast media has churned out many programs making heroes of prohibitionist law enforcement, and very few that made heroes of consumers of contraband.
Kindred questions about what might be called "the circle of ignorance",
regarding the actual merits and hazards of contraband: was Anslinger initially duplicitous, gullible, bad at science, living in some boyhood dime novel, or what? Did these traits worsen over time? And given an insulated bureaucracy that consumes its' own propaganda, whether that must produce a self-selecting culture of delusion, and if so how long did that process take?
An added use of laws that prohibit those drugs favored by the poor and minorities, is that a ruling party can, without seeming vindictive, employ selective enforcement as a secret weapon with which to punish, defame, humiliate, threaten, blackmail, (and perhaps subvert or "flip"), or sometimes eliminate prominent political rivals and their allies. When combined with criminal disenfranchisement, a wealthy ruling party can prolong its power by using (a drug-based) disenfranchisement more generally to reduce the size of its rivals' voter base.
In which vein Ira Glasser argues that drug prohibition remains primarily a subversive de facto extension of racist Jim Crow laws:
...despite these origins, and drug prohibition existing since 1915, as late as 1968 relatively few people were imprisoned for possessing such drugs. But something happened in 1968. What happened was the culmination of the civil rights movement, as reflected in the civil rights legislation of the mid-60s, and especially the Voting Rights Act of 1965. This was very similar to the era after the passage of the 13th, 14th and 15th Amendments, when it appeared as if a new dawn of equal citizenship rights for African-Americans had arisen. But just as the Black Codes and Jim Crow laws arose shortly after the post-Civil War Amendments as a replacement system after slavery for the continued separation and subjugation of African-Americans, so the War on Drugs, initially announced by President Nixon shortly after his election in 1968, and kick-started again in 1980 by President Reagan, and tolerated and continued by a succession of Democratic presidents, became, and was perhaps intended, as a replacement system of separation and subjugation of African-Americans in the wake of the destruction of the legal infrastructure of Jim Crow by the civil rights laws of 1964, 1965 and 1968.