You're grossly oversimplifying this. Remember Iraq? Afghanistan? It's easy for a large army to topple a government or kill some leaders. But groups like ISIS and Al-Qaeda are basically ideologies that rely on guerilla warfare (al-Qaeda moreso than ISIS, since ISIS at least wants to establish a caliphate).
These wars have been going on for decades and are guaranteed to continue for decades more. Even if ISIS was completely wiped out, there would still remain the ideologies and history that making recruiting for such groups possible. Knocking over governments like in Iraq, Syria, and Libya, just creates even more power vacuums for these groups to grow and recruit in.
I'm not sure what the best solution would be. The U.S. and NATO seem content to just keep fighting proxy wars for the upcoming decades. Personally, I'd rather accept refugees and put the effort into successfully integrating them in Western culture. This would probably be much easier in the U.S. which already has a long history of immigration and serving as a "melting pot" of cultures. Maybe more difficult in Europe. Another big problem is the xenophobic and racist attitudes towards immigrants, and it's hard to successfully integrate people when they're forced to live amongst those kinds of people.
I'm not saying immigrants should be forced to abandon their cultures, just that leaving them to fester as an outgroup in impoverished countries lacking strong institutions can't possibly help win an ideological war. Many Western countries are already suffering from population decline. Offering a new home where the influence of toxic ideologies is weaker seems a better solution to me than indefinite war with no plan for what happens afterwards.