There appear to be the occasional misconception about the degree of US involvement in Afghanistan from 1979 onwards. Let us start in the beginning. Here is the wiki on Operation Cyclone.
it is undeniable that there was bipartisan US support for the Afghan mujahideen. Mr Carter precipitated the most overt politicisation of sport since 1936 with the 1980 Moscow Olympic boycott. Later, Mr Reagan met the mujahideen in the White House and dedicated a part of the US space program to the mujahideen.
So the narrative is constructed - the Afghan mujahideen in the 1970s and 1980s were not terrorists, but rather freedom fighters. The US abandoned them, post Najibullah, allowing the Taliban to occupy the Islamist space. So let us examine in a little more detail what the involvement was, pre-abandonment. In the 1980's USAID funded the University of Nebraska $50 million to create textbooks for Afghan primary schools. What was in these textbooks?
Consider the following introduction to the Persian alphabet in a first-grade language arts book:
Alif [is for] Allah.
Allah is one.
Bi [is for] Father (baba).
Father goes to the mosque…
Pi [is for] Five (panj).
Islam has five pillars…
Ti [is for] Rifle (tufang).
Javad obtains rifles for the Mujahidin…
Jim [is for] Jihad.
Jihad is an obligation. My mom went to the jihad. Our brother gave water to the Mujahidin…
Dal [is for] Religion (din).
Our religion is Islam. The Russians are the enemies of the religion of Islam…
Let us examine the illustrations in the primer.
This is the wiki on the Haqqani network, supported by the USA since the 1980s.
One could cite numerous examples. Many sites exist, documenting just these facts.
And there is the official 9/11 Report.
Certainly, to us here anyway, it seems the US struck a realpolitik deal with terrorists to defeat the Russians. In terms of that existential conflict, the current situation in Afghanistan can be regarded as an unfortunate blowback - although in real terms, the final effect has been relatively minor. A few thousand US troops have been killed, in return for the complete defeat of the USSR. Historically, for the USA, it seems a pretty small price to pay. We, OTOH, will have to live another generation or more with the instability created in South Asia. But the events that led up to this should at least be acknowledged.