The ruling came after a lawsuit was filed on behalf of families with transgender or nonbinary children who allege their health care had already been compromised by the president's order.