If weaker societies or governments do not wish to fall then they must strengthen themselves sufficiently (whether by economic, military or ideological means) to resist whatever aggression they are facing, such that any outside assistance can be limited in scope to that which can realistically be provided under the UN banner. If that means Western states putting greater emphasis on defensive measures against the consequences of hostile regimes establishing themselves overseas, including refusing admittance to any resulting waves of refugees, I think a majority of the Western populace would gladly accept that.
The terrorists are getting outside support but apparently the western "I'm alright Jacks" are going to win by doing the opposite? That huge land area filling up with billions of people getting under the control of religious zealots that don't believe in birth control and somehow you think you are going to succeed by pretending your part of the planet can be ring-fenced? Wow.