The family detention centers the Obama administration has been operating in Texas and Pennsylvania have been an expedient way to handle the soaring numbers of Central Americans, many of them young children, who have arrived at the Southern border since 2014. They give a sense that Homeland Security has the border situation under control, and they supposedly send a message to other would-be refugees not to come.

But these privately run, unlicensed lockups are no place for children. Or mothers. Their existence belies President Obama’s oft-professed concern for the humane treatment of people fleeing crime and violence in Guatemala, Honduras and El Salvador.

And the centers stand on dubious legal ground. Last year, a district judge ruled that the administration was violating a 1997 court-ordered settlement, called the Flores agreement, that governs the treatment of underage migrants who seek asylum or enter the country illegally. The judge said the children were being held for too long, and ordered the administration to release them as quickly as possible to the care of relatives or other guardians as their cases move through the immigration courts.

The administration appealed, saying that the agreement applied only to children who had crossed the border alone, not those who were accompanied by parents or other adult relatives. On July 6, the Court of Appeals for the Ninth Circuit disagreed, upholding the district ruling that Flores covers all children, accompanied or not. But it said the administration could still detain their parents.