Americans entered Iraq and Afghanistan after numerous attacks including 9/11 on US and UK, the aim is to make these countries safer by attacking the terrorists on their own turf. Terrorist attacks have fallen greatly and the losses have been on a small scale to the 1,500 killed in one instant in the 9/11 attacks.
Also their is not alot America or Britain can do to stop these terrorists entering the country. Sure the majority arn't of European origin but a large amount of them have been in this country for generations and have contained their views for a large amount of time.
Some people would argue that the British and American's were the terrorists for invading IRAQ/AFGHAN but i think its comparitive to Israel/Gaza conflict. Hamas attacked Israel so Israel hit them alot harder. Some may say it was an act in self defence. 1,400 Palistinans were killed and 13 Israel's perished.