Opium is usually seen and discussed from today's values. When considering history historical values should be used. Than the fact is that opium processed for smoking could be legally imported into the United States until year 1909.
It was heavily taxed though and if smuggled, this was done to avoid the taxation basically in the same manner as how tea was smuggled into England from Holland during the 18th century. Opium was used socially, similar to today's alcohol and tobacco and also found an important medical use for anesthetics, without little surgery or amputations whatever the cause could have been performed. Where opium was not outlawed by state or local ordinance, its use was legal.