Opium (as well as many other addictive drugs) are illegal in nearly every country on the planet, so I have a very difficult time pinning this policy decision on racism.
Again, all hard addictive drugs (opium, heroin, cocaine) are illegal in pretty much every country on the planet (save the recent notable exception of Portugal). Many of these countries have never had a sizable Chinese immigrant community. Is your rationale that they were all somehow biased against the Chinese? Of course, opium is still quite illegal in China today.