What do you think CIA' original motivation is? In my mind, Islamic terrorism exists mostly and mainly as a result of our failed neo-conservative (military) policies in the Middle East.
The terrorism exists due to the arab spring. It's partly foreign interference and partly natural evolution of society. The middle east as a whole is 100 years behind the rest of most of the world due to their geography and infertile land, lack of natural resources besides oil. Since 2011 they've been going through the middle east equivalent of the french, american and russian revolution, which has simply been a stand against oppressive regimes and censorship.
The regimes that exist do so mainly because foreign entities took advantage of their oil reserves and left a huge opportunistic power vacuum in place. However, the real reason ISIL exists is because most of the middle east is weakened due to revolution and as a result they lack proper institution and punishment. On top of that, the citizens living in the area are left weakened by the lack of proper government, and without proper institution and civilization they are more vulnerable to dangerous ideologies.
All in all, the middle east is weak in government and its people are in need of security. As a result, ISIL and other extremist groups are able to ravage through uncontested while the people they conquer are left mostly hopeless. The people that do try to leave in search of a secure and promising life abroad are usually met with "GO HOME RAGHEAD WE DONT WANT MUSLIMS HERE" and other very welcoming messages. Feeling unwelcome, some misguided youth may turn towards extremist ideologies in order to make their grievances heard. Thus continues the cycle of disenfranchisement against middle eastern people.
Its a horrible cycle and one day in 50 years from now we'll probably look back and wish we'd done more about it