  Let $\mathcal{A}(R,S)$ denote the class of all matrices of zeros and ones
with row sum vector $R$ and column sum vector~$S$. We introduce the notion of
an inversion in a $(0,1)$--matrix. This definition extends the standard notion
of an inversion of a permutation, in the sense that both notions agree on the
class of permutation matrices. We prove that the number of inversions in a
$(0,1)$--matrix is monotonic with respect to the secondary Bruhat order of the
class $\mathcal{A}(R,S)$. We apply this result in establishing the maximum
length of a chain in the Bruhat order of the class $\mathcal{A}(n,2)$ of
$(0,1)$--matrices of order $n$ in which every row and every column has a sum
of~$2$. We give algorithmic constructions of chains of maximum length in the
Bruhat order of $\mathcal{A}(n,2)$.
