Imperialism and illicit drugs commonly go together. However, with Taliban opium eradication efforts in full effect, heroin is in short supply, and experts fear that a new fentanyl crisis could be brewing in the US.
I think it comes down to the US being tolerant because winning hearts and minds was more important than destroying Opium. The Taliban has no such qualms.