"You can probably trace it back to our arming of the mujahadeen in Afghanistan so they could defeat the Soviets."
Oh, good grief. A few stinger missiles and some small-arms ammunition does not constitute "arming" a country.
Furthermore, the moderate governments (especially the Egyptians) warned Reagan that this was a mistake and would only emboldened them.
Reading their literature and the fatwas clearly show that they saw their defeat over the much tougher Soviets as proof that Allah was with them and would aide them in destroying the West.
The two acts are related.