Judge says homeland security secretary predetermined her decision, did not consult with other agencies.