The decision marks a major setback for the administration, which has removed tens of thousands of unauthorized immigrants to countries where they are not citizens.