It's neither poverty nor democracy, stupid
The liberal crowd would like to think that people doing evil can be "explained" by the fact they were poor and desperate. These doctors were not poor or desperate by a long shot.
The conservative crowd like to think that if only democracy is spread through what today may be totalitarian autocratic states, the magic potion of democracy will convert potential terrorist into humanistic, benevolent citizens. The UK terrorists of last week had all the benefit of liberty of the UK and the spread of democracy to Palestine gave us a Hamas government. So it's not really working according to the script.
The problem really is religion in general and in particular a religion which allows for extremist notions of killing everyone who does not believe the same. If there is such a thing as moderate Islam, it is the only force that can displace extremist Islam by more strongly asserting itself. Absence of poverty or presence of democracy won't do it.
So at the end of the day, as with African aid or the "revolutions" of various shades (orange, velvet etc), it is up to the community to deal with its problems and its problem children, whether they are dictators or terrorists.