It's not hard to figure out why school officials and police in Irving, Texas, decided to arrest, interrogate, and suspend a 14-year-old student who had brought in a homemade clock. The student, Ahmed Mohamed, comes from a family that is Muslim and of Sudanese descent.

This is textbook racial and religious profiling: Mohamed looked like what the Irving police thought terrorists looked like, so they treated him differently.

It's also the perfect example of why profiling doesn't work. And yet, the idea remains disturbingly popular. Just Tuesday, the writer Sam Harris endorsed profiling on a radio appearance: "If Jerry Seinfeld’s going to the airport, [and] he gets the same search that someone who looks like Osama bin Laden does, that’s a crazy misuse of resources."

But Harris, like other proponents of profiling, is wrong: According to security experts, profiling doesn't work, and may actually be counterproductive. It's also dehumanizing and leads inevitably to abuses — as Ahmed's infuriating case demonstrates.

Who "looks" like a terrorist?

Here is the fundamental problem with racial and religious profiling: It is impossible to figure out who "looks" like a terrorist.

People like Harris insist that it's obvious — as he's written, "young Middle Eastern men show upon [sic] on the news, again and again." But that's false. Palestinian militant groups have repeatedly used women as suicide bombers to evade Israeli security profiling. Many of ISIS's fighters, including one of its top commanders, are from Chechnya — and it has thousands of recruits from central and western Europe. Jose Padilla, who was arrested in 2002 as an al-Qaeda operative, is Hispanic and grew up in New York.

So if you limit your profiling system to young Middle Eastern–looking men, like Ahmed, terrorists can and do use people who just look different from that. No matter how inclusive the system, this will always be a problem. Profiling, then, could actually make us less safe: It gives terrorists a how-to guide for evading extra airport screening and police attention.

"Targeted policing may actually increase total incidents of terrorism by encouraging the non-profiled group members to engage in terrorist acts — since the price to them has decreased," Columbia University scholar Bernard Harcourt wrote in a 2006 study.

Other research shows that profiling doesn't work. A 2009 mathematical study found that profiling systems have a fatal flaw: They would keep screening the same people who fit the profile, every time they got on a plane or entered a building, over and over again. They will end up guiding security resources to target people who, in all likelihood, weren't security threats — and directing those resources away from actual threats.

Security expert Bruce Schneier, in a 2012 debate with Harris on the merit of profiling Muslims in airports, summarized all the ways that it not only fails but actually makes us less safe:

We have decreased security resulting from our imperfect profile of Muslims, decreased security resulting from our ignoring of non-Muslim terrorist threats, decreased security resulting in errors in implementing the system, increased cost due to replacing procedures with judgment, decreased efficiency (or possibly increased cost) because of the principal-agent problem, and decreased efficiency as screeners make their profiling judgments. Additionally, your system is vulnerable to mistakes in your estimation of the proper profile. If you've made any mistakes, or if the profile changes with time and you don't realize it, your system becomes even worse.

Profiling makes sense if you believe that only people who look a certain way are capable of committing a certain crime. But this is not only unfounded, as actual security experts know — it also relies on lazy and, yes, bigoted thinking about who might and might not commit acts of terrorism.

That bigotry might seem unfortunately necessary to people when it takes place at an airport, but as the research shows it's not actually effective and sometimes, with incidents like the arrest of 14-year-old Ahmed Mohamed, we are forced to confront that this sort of profiling is not only ineffective but wrong and harmful. Not only are we failing to protect schools or airports when we profile, but we are actively harming some of the innocent people who patronize those institutions just because they happen to have the wrong appearance.