In the 90's, the US-based UNOCAL corporation was interested in building a natural gas pipeline through Afghanistan which would move gas supplies from
Turkmenistan to Pakistan and India primarily.
In 1998 the Clinton administration refused to recognize the Taliban government and attempted to bomb Al Qaeda training camps. UNOCAL immediately withdrew from any pipline project in Afghanistan and released a
statement which in effect said that as long as the US and the UN would not extend diplomatic recognition to the Taliban as the legitimate government there, then they wanted out of the project.
So if the priority of the US has been to build the pipeline (which would not even directly benefit us) then the easiest thing in the world would have been to NOT go to war in Afghanistan and to accept the Talibs as the legit government there. Simple no?