People gather outside the Department of Health and Human Services. (Michael S. Williamson/The Washington Post)

IN OCTOBER, the government tried and failed to keep an undocumented teenager in federal custody from ending an unwanted pregnancy. Yet officials appear to have learned little from 17-year-old Jane Doe's victory in court over the government's effort to keep her from the abortion clinic. Again, it has fought tooth and nail — and failed — to prevent two more pregnant teenagers from getting the medical care they desired.

Since his appointment by President Trump to head the Department of Health and Human Services' Office of Refugee Resettlement (ORR), antiabortion activist E. Scott Lloyd has barred federally funded shelters for undocumented minors from "supporting" access to abortion without his approval. Mr. Lloyd has reached out personally to convince some teenagers against ending their pregnancies. Others, like Ms. Doe, are forced to attend "life- ­affirming options counseling."

Last week, the American Civil Liberties Union filed suit on behalf of two more undocumented teenagers whom ORR blocked from obtaining abortions. Like Ms. Doe, both are pregnant and crossed into the United States without their parents.

Both will now be allowed to get their abortions. A federal district judge allowed one teenager to travel to a clinic as of Monday. And the Justice Department dropped its appeal of the other teenager's case after discovering that she was 19 years old, not 17 — meaning that Immigration and Customs Enforcement, not ORR, should take custody of her as an adult. ICE has now released her. But even if it hadn't, ICE allows undocumented women in its care to obtain abortions as a matter of policy.

The collapse of the court case demonstrates just how absurd ORR's policy really is. The government acknowledges that the Constitution grants these teenagers the right to an abortion. Yet when a 17-year-old and a 19-year-old have the same right under Roe v. Wade, how can the government justify summarily blocking one from obtaining an abortion but not the other? The rest of the government's case was equally flimsy. ORR argues that it has no obligation to "facilitate" the procedure — though in each case so far, the logistics and costs have been privately arranged, leaving ORR with the responsibility of simply getting out of the way.

ORR also made the case that the teenagers could simply leave the country or depart federal custody for a government-approved sponsor. But the fact that a person could cross back across the border doesn't strip her of constitutional rights while in the United States. And each week it takes to find a suitable sponsor makes abortion more difficult and dangerous to obtain.

It's welcome news that the government is no longer abusing its power over these two vulnerable teenagers. Yet even as the ACLU mounts a broader legal challenge to ORR's behavior, it's likely that ORR will continue to trap other undocumented teenagers in the same situation. Mr. Lloyd should abandon this cruel policy.