The decision permitted the Trump administration to continue restricting inspections of the conditions inside immigration detention compounds.