On Monday the Supreme Court handed down a preliminary ruling on President Donald Trump’s ban on immigration from Muslim-majority countries. The ruling is a mixed bag with something sure to disappoint everyone. The court partially upheld two lower court decisions that prevented the ban from taking effect on a temporary basis and agreed to hear the case in full this fall. But by that time, the court hinted, the whole case may be moot.

It was a mistake for the court to allow even part of the ban to go into effect, disregarding the harm that religious discrimination inflicts on Americans, not just Muslim visa applicants. But the ruling is also a loss for the Trump administration and a strong indication that the justices are skeptical that the ban serves a legitimate national security purpose.

The Supreme Court’s ruling partly lifted the injunction on the ban, allowing the Trump administration to ban immigrants from six predominantly Muslim countries, but only if they do not claim a “bona fide relationship” with someone in the U.S., such as a family member, employer, or school. Trump supporters may be tempted to view this as a victory, but it is nothing of the sort. It actually creates a complicated, fact-intensive test that must be applied on a case-by-case basis—the opposite of a blanket “ban” on Muslim applicants. And in order to arrive at that resolution, the court implicitly rejects the idea that a complete ban is necessary or can be justified on national security grounds. If the justices had believed that it was a necessary stopgap while the Trump administration revised its visa vetting procedures, then the court would likely not have continued to block just a part of it.

Nonetheless, opponents of the ban will not be totally happy with today’s decision either. The court split the proverbial baby by allowing the government to block visa applicants, including refugees, with no demonstrated connection to the U.S. That logic is baffling at best. First, refugees are not coming here because they have an aunt in Chicago; they are fleeing for their lives from war-torn counties, seeking safety and desperate to survive. Second, there is no reason to assume that would-be terrorists couldn’t find a way to claim some “bona fide” connection to the country. Third, the opinion ignores one of the primary arguments that moved lower courts: the harm inflicted on all Americans when the government sanctions religious discrimination. The First Amendment prohibits such policies because they fray the very fabric of America’s democracy, an injury that appears to have escaped the court’s careful consideration.

It is possible that the justices will take a different approach this October when they hear the case in full. More likely, however, the court will deem the case “moot” and avoid reaching those difficult issues entirely. The court hinted as much by ordering the parties to argue why the window for deciding the case has not already closed (the order only called for a 90-day ban, which would have expired on June 14). Indeed, by the time the court hears the case in full, every operational part of the executive orders at issue will have likely expired.

In the meantime, the court has created a big bureaucratic mess, requiring both government officials and visa applicants to document and decipher what counts as sufficient connection to the U.S., before considering whether someone is eligible to apply for an American visa at all. This new process, like the Muslim ban itself, has no obvious relationship to securing our borders or protecting national security. Even in its truncated form, the Muslim ban is nothing more than a discriminatory, political act that betrays our country’s history and values.