9/11 occurred before the US invaded Iraq/Afghanistan, as did the Embassy bombings in Africa, the attack on the USS Cole, the previous attempt to blow up the WTC. All the US did to deserve these attacks was to station some planes in a Muslim country... we had done similar and were also at risk.
The Boston bombing was carried out by a Chechen, this recent attack in London apparently by (seemingly) a Nigerian convert and (presumably) a Somalian.... at any rate neither of them were by people actually from Afghanistan or Iraq rather they were people who simply affiliated themselves with those people as a result of a shared core ideology. Iraq and Afghanistan might have served to anger some and increase the risk of attacks but radical Islam was there already and would still have been. Iraq was a farce tbh... though I don't think that an interventionist foreign policy should be dropped in general as a result of the existence of some radical loonies. That is the main issue - not the foreign policy but these radicals with their particular brand of Islam. In fact aside from Iraq I don't think intervention in Bosnia, Kosovo, Sierra Leone, East Timor, Afghanistan, Libya and Mail was unwarranted.