I am only aware of the US history, but the early laws barring opium dens had nothing to do with health concerns, they were anti-Chinese laws. At the same time as the dens were starting to be shut down, opium was a hugely popular panacea available in over the counter in every drug store.