As Republican presidential candidates toughen their stances on America’s undocumented residents, a federal judge in California has ruled that a policy based on “fear-mongering” by the Obama administration violated the rights of migrant mothers and children who crossed into the US last year.

On Friday, US District Judge Dolly Gee called the Obama administration’s argument that releasing some 1,400 children and mothers from three detention facilities in Texas and Pennsylvania would inspire more illegal border crossings “speculative.” Judge Gee ordered the government to release them “without unnecessary delay.”

The ruling – which reinforces a similar order Judge Gee handed down last month – could move the needle slightly on a deeply political problem for the US: How to balance basic constitutional and human rights of migrants with the bureaucratic challenge of stemming lawless migration across the country’s southern border.

Judge Gee’s finding that migrant women and children are being held in “deplorable” conditions also touches on a growing political debate over natural, or inalienable, rights, which infuse the Constitution. That includes the 14th Amendment, which says that anyone born in the US is a US citizen.

Presidential candidates, including Republicans Donald Trump and Ted Cruz, have argued for the repeal of the 14th Amendment, to deter foreign mothers from traveling to the US to have their babies. But that stance, critics say, undermines core American values, including respect for natural rights of human beings above immediate interests of the state.

“The ironic part about this, is that a group of people who pride themselves on their patriotism and belief in American exceptionalism are literally doing the opposite – undermining a tradition that exists primarily here in the Americas,” writes Zaid Jilani, on the progressive AlterNet website.

Proposals by GOP frontrunner Trump, for example, would round up and deport all of America’s 11 million undocumented immigrants, an effort that would dwarf the detention of Japanese immigrants during World War II.

Driving such rhetoric are broader fears among many Americans that undocumented immigrants not only suppress wages for citizens, but that they are prone to criminality. Meanwhile, the 2010 Census found that native-born American men without a high school diploma are five times as likely to be incarcerated as foreign-born men from El Salvador and Guatemala.

"You look at Chicago, if you look at Baltimore, if you look at Ferguson, a lot of those gangs — and the most vicious – are illegals,” Mr. Trump said at a recent event. If he's elected president, Trump added, "They're out of here, first day. I will send those guys, those guys are out of here!"

A long-running tradition by GOP candidates of demonizing illegal immigrants, according to the party’s own post-election analysis, is likely to hurt its chances of winning national elections, given demographic shifts. For one, 14 percent more Hispanics will be eligible to vote in 2016 than 2012, when Mitt Romney lost the presidential election to President Obama.

But Friday’s ruling also puts the Obama administration in a difficult position, as it debates whether to appeal Judge Gee’s order.

Already under pressure to end record numbers of deportations under his watch, President Obama could face anger from Democratic allies and immigrant rights advocates if his administration appeals Judge Gee’s order to release the mothers and children to await a deportation hearing that, thanks to a backlog of cases, could take years.

The Obama administration is concerned that the ruling will turn “the children into a kind of human shield against detention and could invite a new wave of illegal immigrants who bring their children on the dangerous journey, knowing that they will quickly be released and can quickly disappear into the shadows here,” writes Stephen Dinan, in the Washington Times.

The heated rhetoric around the migrant children and immigration more generally has also confounded efforts to rewrite America’s immigration laws to bring the undocumented out of the shadows.

“Those whose aim it is to stop legal immigration reform are using the kids to fan fears and turn a humanitarian crisis into political blackmail for anyone even contemplating positive changes in current law,” New York Post columnist Linda Chavez wrote last year.

The main issue in the detention case, Gee argued, is that the Obama policy violates a 1997 settlement agreement made between the Clinton Administration and immigration lawyers, which limited detention of children to 72 hours. Gee ruled that that agreement also extends to mothers swept into custody with their children.

Judge Gee acknowledged that the sheer numbers of children and mothers has at times made such a deadline unrealistic. But in her order, Gee charged that immigration officials "routinely failed to proceed as expeditiously as possible to place accompanied minors, and in some instances, may still be unnecessarily dragging their feet now."

Between September 2013 and October 2014, some 68,000 migrants – mostly mothers with children in tow – were taken into custody at the border. That number has been halved in the ensuing months, largely, authorities say, because of improved enforcement in both the US and Mexico.

US authorities expected a drop in the numbers this summer, but the number of migrants bumped upward in July, suggesting another surge in border crossings.