U.S. ​Department of Homeland Security adopted the policy ‌based on “exceptionally weak” rationales, the Judge said