The US government supported the Taliban, as well as numerous other Afghany rebel groups against the Soviets in the 80’s (they talk about it in the movie Charlie Wilson’s War). Essentially we wanted Afghanistan to be the Soviets Vietnam, and it worked, they abandoned it and ran back to their crumbling empire. We gave the Taliban, and Osama Bin Laden himself intelligence, weapons, training, etc.
That was one of the reasons he hated America. When the Soviets left, so did we. We didn’t help them rebuild or establish some kind of central government… and they descended into a long civil war… which the Taliban emerged victorious from.