If we passed a law that stated, "for every terrorist attack committed by any discernible demographic group, whether religious, racial, ethnic, cultural or ideological, if that attack falls in line with what has been on average over the last fifty years the group most prone to engage in terror, above twice that of the next highest group, that group loses the right to have any further immigrants of the same grouping come into the nation for the next ten years, or have any children for those who live within said nation. If a new terror attack occurs before the ten year time limit is up and they still rate as the highest risk demographic, over twice that of the next highest group within the moving 50 year average, the time limit resets and a whole new ten year penalty for the entire collective must be served."
This law does not discriminate against anyone, and applies equally to all. If a group simply cannot control its individuals, if it is so volatile that it is always well above average in violent individuals who cause havoc to the greater community, then they simply lose the right to continue to exist. If it's a temporary thing and a group gets its malcontents under control, the immigration and baby booms are still available for everyone within that group, but if they can never get their shit together, then they can all die together. (of old age, of course, no one will lift a hand to do any harm to terror prone demographics directly.)
It's time for members of a group to police their own group. Shame them, guilt them, bribe them, kill them, do whatever it takes, but it's a collective's responsibility to not be a burden to the collective, and therefore when they fail in that responsibility the punishment needs to also be collective. Otherwise the bad behavior will never end, and for every individual we strike down, ten more like hydra heads will sprout from previously unforeseen sources. The problem will never get under control, and in the end it will destroy us long before we ever manage to destroy it.
Morally speaking, those who sanction an act are indistinguishable from the doers, and it is impossible that all these people would randomly be doing terror attacks so disproportionate to the size of their population if they had no support from the people around them encouraging them to do so. There is a limit to 'random chance.' If one distinguishable faction of a polity is always the ones behind everything, then there's no pretense of innocence anyone in that group can sell anymore. There's something wrong with that community, I don't care what, and I want it fixed, I don't care how. That's your problem, because you're the cause of the problem. But you won't get to immigrate here or reproduce until the terrorism problem is fixed.
Most of the people preying on others via terror are not psychopaths. They have a community they care about, and they are trying to promote the fortunes of that community. If you make it clear that their actions will have adverse consequences for the people they care about, that terrorism won't get them anywhere but wholesale destruction, 99% of these killers will drop their plans and go back to a peaceful coexistence. For the psycho killers who really could care less what the consequences of their actions are on their own group, I suggest said group quickly take them out themselves, before the terrorism happens, or they'll be paying the price of said psycho for many years to come. And it's impossible that you don't know who these people are. Everyone is born into a family, everyone is known to someone, unless they're raised by wolves. You know who these people are, and you know what you have to do. Period.
Don't blame us when we punish you according to this law for not policing yourselves sufficiently. Blame yourselves or God.