>People seem to want to pin these things on ideology, because that's the reason the perpetrators themselves give for what they do. But it seems more likely to me to be a reaction to a life they view as having no future, by which I mean no prospect of a successful romantic relationship with the opposite sex.
It's both. A combination of hopelessness for their future and an ideology that can be seized upon to fill that same void.
50 virgins in the afterlife is the simplest example of this. Whom might such a future appeal to? Not so much the successful family man, I think. But it's not the only ideology that fits the bill. If you can promise any kind of wider purpose to someone's life (e.g. save your race!) that'll inherently appeal to a portion of the people that feel their life lacks meaning. If that group gets bigger AND an ideology gets increasing mind-share, you get the phenomenon we're now experiencing.