Judge Melissa R. DuBose said the department had placed arbitrary conditions on grants created by the Violence Against Women Act.