Monday’s U.S. Supreme Court decision to allow a limited version of President Donald Trump’s travel ban to proceed until the court rules on the full case this fall was not a “clear victory for our national security,” as the president claimed in a triumphant tweet.

Instead, it amplified a damaging message in the U.S. and abroad, undercutting efforts to counter violent extremism. The ban targets six mostly Muslim nations — Iran, Libya, Somalia, Sudan, Syria and Yemen. That fact betrays American values and quite possibly the Constitution itself — a conclusion the court may still reach when it eventually rules on the matter.

In the meantime, the court’s compromise to allow travel-ban exceptions for “foreign nationals who have a credible claim of a bona fide relationship with a person or entity in the United States” is likely to prove problematic.

Indeed, Supreme Court Justice Clarence Thomas, writing in dissent on behalf of himself and Justices Samuel Alito and Neil Gorsuch, predicted complications when he wrote: “I fear that the court’s remedy will prove unworkable. Today’s compromise will burden executive officials with the task of deciding — on peril of contempt — whether individuals from the six affected nations who wish to enter the United States have a sufficient connection to a person or entity in this country.” Thomas predicted a “flood of litigation” in the wake of the order.

Thomas, Alito and Gorsuch were arguing for an even less desirable outcome — implementation of the full ban until the court rules. If Monday’s decision was a victory for Trump, who promised “a total and complete shutdown of Muslims entering the United States” during the campaign, it was a narrow win.

“It’s always been crystal clear that this policy was based on discrimination,” said Amnesty International USA Executive Director Margaret Huang in a statement.

Further, “there is no reasonable national security justification for these measures,” said Eric Schwartz, former dean of the University of Minnesota’s Humphrey School who is now president of Refugees International, in a statement. “More importantly, the suspension of refugee resettlement will impact the most vulnerable of the world’s populations, including refugee women and girls, survivors of violence and torture, and refugee children, among many other groups at considerable risk.”

The fate of those groups is of great concern to the Immigrant Law Center of Minnesota, said John Keller, the organization’s executive director. “What we’ve seen is all of the courts — both district courts and courts of appeals — that have taken the necessary time to study it have seen it for what we believe it is, and that is an unconstitutional ban on individuals because of their faith, primarily, and not because of any sort of national security provable or tangible evidence the administration has put forward.”

No American who values national security would want anything short of thorough vetting for those coming to the U.S. But that system is in place, and the U.S. need not jettison its fundamental values by banning Muslims simply because of their faith.