Correlation does not equal causality.
The mujahedin was indeed armed by the United States to fight the Soviets. The mujahedin did, in fact, become Al-Qaeda.