Opinion by Nathan Lean, special to CNN

(CNN) - The attacks of September 11, 2001, were unthinkable, and are rightfully memorialized with the somber reflection that marks other tragedies of our nation’s past.

From the Oval Office that Tuesday evening 12 years ago, President George W. Bush addressed the stricken nation with a message of hope.

“Terrorist attacks can shake the foundations of our biggest buildings, but they cannot touch the foundation of America,” he said. “This is a day when all Americans from every walk of life unite in our resolve for justice and peace.”

Sadly, though, out of that dark hour came more darkness.

Throughout the past 12 years, government agencies and local law enforcement have often turned inward, eroding the liberties of ordinary, law-abiding citizens.

In the name of defending national security, they’ve fractured relationships with American Muslim communities and undermined the foundations of freedom on which this land was built.

Anti-Muslim sentiment in the United States has not only manifested itself through mosque arsons, assaults, murders and invariably hostile rhetoric from society’s extreme fringes. It has also become a permanent fixture of the very institutions that should provide safeguards against those things.

A long view of the response to terrorism since 9/11 suggests that Islamophobia — an irrational fear or suspicion of all Muslims and Islam based on the actions of a few — is increasingly legislated and enforced.

The most recent example of this comes from the city that bore the brunt of the 9/11 attacks.

READ MORE: My son died as a first responder on 9/11

Revelations surrounding the NYPD’s surveillance of Muslim communities in Brooklyn and Manhattan show that, without specific evidence of criminal activity, police officers teamed up with the CIA to form a clandestine intelligence program that spied on ordinary Muslim Americans.

The program sent “rakers” into Muslim neighborhoods to observe restaurant owners and shop keepers, deployed “mosque crawlers” into Muslim houses of worship to monitor sermons, and planted undercover agents on a university rafting trip in Buffalo where they took notes on how many times Muslim students prayed each day.

It gets worse.

The NYPD parked a yellow taxicab, bugged with cameras and voice recorders, outside a popular mosque in Brooklyn, hoping to capture Friday prayer-goers mumbling something about terrorism.

They also designated all mosques in the city as terrorist organizations, meaning that anyone who attends worship services is a potential subject for investigation, and they attempted to infiltrate the board of the nonprofit Arab American Association of New York, labeling the group a “terrorism enterprise.”

The six years of surveilling American Muslims led to no arrests or leads, the head of the NYPD's Demographics Unit admitted in court testimony.

The NYPD says its surveillance programs are lawful and orchestrated to keep the city safe from "those who are intent on killing New Yorkers."

The FBI criticized the NYPD spying program, however, saying that it produces a “negative impact” and makes their job harder than ever.

But it was the FBI who, in 2010, paid informant Craig Monteilh more than $11,000 a month to disguise himself as a convert to Islam, infiltrate Southern California mosques, and have sex with Muslim women. The plan was to entrap young Muslims by initiating conversations about “jihad” and terrorism.

In the end, the very people he was spying on reported him to the FBI — the organization that sent him there. Last year, Monteilh expressed his regret for participating in the sting operation, saying, “There is no hunt. It’s fixed.”

The FBI said its program, called "Operation Flex," was "focused on fewer than 25 individuals and was directed at detecting and preventing possible terrorist attacks."

The FBI came under fire again in August of this year as we learned about a covert security program in conjunction with U.S. immigration authorities.

The American Civil Liberties Union reports that the FBI and immigration officials have the authority to blacklist law-abiding Muslim Americans who have applied for citizenship, flagging their applications on the basis of “national security concerns” and sidelining their path to nationality for years on end.

Those applications are primarily docked on the basis of the applicant’s name, their country of origin, or as a result of their travels to countries on a watch list.

The U.S. Citizen and Immigration Services says its reviews comply with immigration laws.

READ MORE: It’s time for Islamophobic evangelicals to choose

Anti-Muslim prejudice is institutionalized at the state level, as well.

Over the past two years, lawmakers in 32 legislatures across the country have targeted Muslims by moving to ban Islamic law, or “Shariah.” Seven states (most recently North Carolina) have signed the proposed ban into law, despite the inability of legislators to name a single specific case in which a court ruling based on Shariah law was allowed to stand.

Additionally, mosque construction projects in states like Oklahoma, Tennessee, California and Minnesota have faced backlash from local lawmakers who, failing to thwart their construction by advancing arguments about Shariah or the supposed threat of radicals, resorted to pretenses like traffic patterns, zoning regulations, parking restrictions and noise ordinances to block the building permits.

This cannot be our response to tragedy.

We’ve lost our way, and the path that we are traveling down today is hardly representative of the sacred foundations that our founding fathers envisioned.

Surely we can, and we must, remain vigilant in our effort to combat those who threaten us, but we cannot be so overly zealous in our aim to root out potential perpetrators that we abandon our national values and strip our fellow citizens of their unalienable and constitutionally protected rights.

That doesn’t make us stronger; it makes us weaker, and more vulnerable.

Nathan Lean is the editor-in-chief of Aslan Media and the author of four books about the Middle East, including "The Islamophobia Industry." Follow him on Twitter at @nathanlean.