The Mujahideen were not the Taliban, which did not exist until 5 years after the Soviet-Afghan War. Some of the US-backed resistance fighters did go on to join the Taliban, but others opposed it and later sided with the US when they invaded in 2001.
https://en.wikipedia.org/wiki/Afghan_mujahideen#Relationship...
All that being said, obviously the US has failed repeatedly in Afghanistan, but the initial intervention against the Soviets was not the main factor. The Taliban's persistence is due to multiple US geopolitical blunders that happened in the decades after the Soviet-Afghan War.