Democratic elections in both Iraq and the Palestinian Territories, as well as Lebanon have done exactly that - elected popular governments hostile to the US or its foreign policy goals. Some have suggested that more important than democracy in those governments is economic progress.
Islamic extremism is most popular with groups of people and regions that are living in abject poverty. Radical Islam, in other words, sounds good to those who have nothing to lose by pursuing it. For this reason, some have argued it would be better to fund a new school system in countries like Pakistan than it would be to conduct military offensives or missile strikes. In the absence of such a school system, radical Islamic groups have created Madrassas, which preach and teach and very extreme form of Islam, and generally contribute to terrorism's development.