I think there are many types of terrorists. Some are idiots who think blowing up people for a higher cause is just -- this is patently false, illogical, and wrong-headed.
Some have themselves seen horror perpetrated by their targets, ie have lost a loved one, or been humiliated by a larger state (probably a lot of this goes on in Palestinian terrorism) -- more understandable but still no excuse.
Some of it is caused by poverty, and most particularly unemployment -- a world economy where millions upon millions of young men are bored and poor, because there are no jobs is a recipe for disaster (much of what goes on in both Iraq and Israel/Palestine is probably related to this). Boredom breeds vulnerability to idiotic ideas / solutions