The September 11th terrorist attacks not only led to the tragic deaths of 2,977 people, they fundamentally changed the nature of immigration law and policy in the United States.

Since 9/11, the U.S. government has viewed every non-U.S. citizen seeking to enter the country as a potential threat. Foreign tourists and students, temporary workers, permanent immigrants, refugees, asylum seekers, and undocumented immigrants are all now evaluated first and foremost through the lens of national security.

The goal of preventing foreign terrorists from ever again mounting an attack within the United States is certainly understandable. But politicians have used the fear of another terrorist attack to justify harsh immigration policies that stereotype and dehumanize any non-citizen who wants to visit, work, or live in the United States. This often comes at great cost to civil liberties and with little value to counterintelligence. And while the anti-immigrant policies of the Trump administration were particularly egregious in this regard, no presidential administration of the past 20 years has managed to move beyond the fear-driven policies of the post-9/11 era.

The single-minded focus on security after 9/11 was exemplified best by the decision in 2002 to dissolve the Immigration and Naturalization Service (INS) and assign its functions to the newly created Department of Homeland Security (DHS). The primary mission of DHS was to prevent another terrorist attack on U.S. soil.

DHS not only took over the immigration enforcement duties of the former INS, but also became responsible for providing immigration benefits, such as the granting of U.S. citizenship, lawful permanent residence, and work authorization.

For decades before it was absorbed by DHS, the branch of the INS that had granted immigration benefits viewed its work through a different lens. Part of its mission was to provide decent customer service to people who were applying (and paying for) benefits. But that mindset changed completely once DHS took over the job.

Under DHS, the primary goal was to prevent potentially dangerous individuals from obtaining benefits rather than ensuring that qualified individuals obtained benefits in a timely fashion.

The security-first mentality of the U.S. government after 9/11 also became apparent in the harsher treatment of refugees and asylum seekers. Some asylum seekers saw their claims denied because they had been forced to flee their home countries using fraudulent documents—even though they obviously could not obtain valid documents from the governments that were persecuting them. Even victims of terror groups were denied access to asylum or refugee status because they had been forced at gunpoint to provide material assistance to their captors.

At a broader level, 9/11 caused many policy makers and much of the public to lose sight of the fact that immigration is a complex economic, political, social, and historical issue. Under the prevailing post-9/11 mindset, creating immigration policy has become little more than devising new ways to keep potentially “bad” immigrants out of the country. But managing migration is a much more complex task, which requires recognizing the benefits of immigration.

The United States was once close to creating a better-managed immigration system. In the weeks before 9/11, the administration of a Republican president—George W. Bush—came very close to negotiating a migration accord with Mexico that would have included the creation of a pathway to legal status for undocumented immigrants who have lived and worked in the United States for many years.

This effort was based on a common-sense recognition of the long-standing historical ties between the two nations, as well as the degree to which undocumented immigrants (particularly from Mexico) had become integrated into the social and economic fabric of the United States. Unfortunately, 9/11 obliterated the possibility of such an accord.

The post-9/11 obsession with security continues to hold back the formulation of any new plan to comprehensively manage migration. Instead, policymakers have spent 20 years throwing more money, resources, and personnel into immigration enforcement along the border and in the interior of the country. The rationale behind this never-ending series of enforcement-only measures is that we can’t risk creating a new and better immigration system until we’ve become truly “safe” by keeping out or kicking out a sufficient number of “bad” immigrants.

However, there is no magic number of deportations or expulsions at the border that will guarantee us absolute safety from foreign terrorists—not to mention home-grown extremism. Fear will not save us from another terrorist attack. But fear will prevent us from creating an immigration system that is more reasonable and humane than the dysfunctional system to which policymakers have been clinging for two decades.