Because the way to get rid of angry, desperate people is to kill them. A better way is to get rid of the desperation, which usually gives them something to lose, which gives them less desire to engage in actions that will lose them. That’s why the War on Terror ended in a withdrawal, and not a victory. Sure, education and economic improvement isn’t very fast, but some governments seem to be more than okay spending a couple decades doing something different.
No, this won’t get rid of all of the terrorists, but how many of the wealthy, educated, married extremists with families are actually willing to risk their lives for their beliefs?