Speculation has been rife about the motives of Omar Mateen, the 29-year-old man who killed 49 and injured at least 53 in a gay nightclub in Orlando. Reports say that he called 911 to pledge his allegiance to the Islamic State shortly before opening fire.

Following an attack of this nature, we can expect two streams of reactions. President Obama, Hillary Clinton and others are of the first type, urging us to condemn retaliation against Muslims. In contrast, Republican presidential nominee Donald Trump is of the second, insisting that the US strictly scrutinize or even ban Muslims from entering the country.

As a result, many Americans may infer that they must make a choice: call upon the value of inclusivity and support American Muslims, or call upon the value of homeland security and take a strong stand against terrorism, and by extension, Muslims.

My results are not surprising to social scientists, who know that humans derive self-worth from the groups we belong to

But my research suggests that this dichotomy is both false and dangerous, as excluding Muslims is more likely to exacerbate terrorist tendencies, while welcoming Muslims is more likely to quell radicalization.

Understanding why requires understanding what motivates someone to become a terrorist in the first place.

Many assume that people who commit terrorist attacks in the name of Islam are religious zealots. Actually, many Muslim radicals were not particularly religious at the get-go. Indeed, a substantial number of Isis sympathizers are converts to Islam – hardly lifelong devotees.

If not religion, then, what is to blame?

Researchers have long studied the motivations of terrorists, with psychologist Arie Kruglanski proposing a particularly compelling theory: people become terrorists to restore a sense of significance in their lives, a feeling that they matter. Extremist organizations like Isis are experts at giving their recruits that sense of purpose, through status, recognition, and the promise of eternal rewards in the afterlife.

My own survey work supports Kruglanski’s theory. I find that American Muslims who feel a lack of significance in their lives are more likely to support fundamentalist groups and extreme ideologies.

What we really need to know now is, what sets people on this path? How do people lose their sense of purpose?

My research reveals one answer: the more my survey respondents felt they or other Muslims had been discriminated against, the more they reported feeling a lack of meaning in their lives. Respondents who felt culturally homeless – not really American, but also not really a part of their own cultural community – were particularly jarred by messages that they don’t belong. Yet Muslim Americans who felt well integrated in both their American and Muslim communities were more resilient in the face of discrimination.

My results are not surprising to many social scientists, who know that we humans derive a great deal of self-worth from the groups we belong to. Our groups tell us who we are and make us feel good about ourselves. But feeling like we don’t belong to any group can really rattle our sense of self.

Bringing this back to terrorism prevention: when politicians espouse anti-Muslim rhetoric and say that Americans shouldn’t trust a community of 3.3 million people, what do they expect? A few hurt feelings at the expense of protecting our homeland?

If only. When politicians propose banning Muslim travel or policing Muslim communities, and when other Americans applaud and echo these sentiments, we send the message that a) Muslims are not really Americans, and b) being Muslim is something to be ashamed of.

According to my research, this is the recipe for making American Muslims feel disenfranchised and discriminated against. We are actually planting the seeds for radicalization and essentially helping Isis recruit by fueling the narrative that the west is anti-Islam.

So, yes, I condemn Islamophobia, but not just because I think it’s morally wrong to discriminate against a religious community. I condemn Islamophobia because the evidence shows that it is only going to worsen the problem we are trying to solve. Does this mean the American government shouldn’t do something about Isis, or that American citizens shouldn’t fight homegrown terrorism? Absolutely not. But we need to reframe our approach, and realize that targeting an entire religion is not going to get us anywhere good.