A federal judge put a temporary hold on the White House directive as Washington and 21 other states filed a lawsuit.