The ruling is a win for the administration against a judge whom the president has sought to fashion into an adversary.
U.S. District Judge James Boasberg launched a criminal contempt inquiry after he said officials defied an order to turn around flights of Venezuelan migrants bound for El Salvador.