A federal judge ordered the agency to reconsider its firings of employees who had been assigned to diversity recruiting.