We tried to train the Afgan fighters. But they were...um..difficult to work with.
So we worked with the Muslim that moved into the area (and which were easier to train).
I doubt we ever expected them to take over the country, much less attack us. These were Saudias, (according to some sources) our best allies over there bar none. Hell, we sell the Saudias some of our better defense equipment. They were fighting Communism. Why WOULDN'T we train them?
(I'm looking for my sources now though.)