The Supreme Court ruled unanimously that the law may not be used against many illegal workers who used false Social Security numbers to get jobs.