Justices ruled that the federal government has been going too far in using identity-theft laws against undocumented workers.