He declared the policy unlawful and said it failed to provide sufficient due process protections.