  We determine the mean number of 2-torsion elements in class groups of cubic
orders, when such orders are enumerated by discriminant. Specifically, we prove
that when isomorphism classes of totally real (resp., complex) cubic orders are
enumerated by discriminant, the average $2$-torsion in the class group is $1 +
\frac{1}{4} \times \frac{\zeta(2)}{\zeta(4)}$ (resp., $1 + \frac{1}{2} \times
\frac{\zeta(2)}{\zeta(4)}$). In particular, we find that the average
$2$-torsion in the class group increases when one ranges over all orders in
cubic fields instead of restricting to the subfamily of rings of integers of
cubic fields, where the average $2$-torsion in the class group was first
determined in work of Bhargava to be $\frac{5}{4}$ (resp., $\frac{3}{2}$).
  By work of Bhargava--Varma, proving this result amounts to obtaining an
asymptotic count of the number of "reducible"
$\operatorname{SL}_3(\mathbb{Z})$-orbits on the space $\mathbb{Z}^2
\otimes_{\mathbb{Z}} \operatorname{Sym}^2 \mathbb{Z}^3$ of $3 \times 3$
symmetric integer matrices having bounded invariants and satisfying local
conditions. In this paper, we resolve the generalization of this orbit-counting
problem where the dimension $3$ is replaced by any fixed odd integer $N \geq
3$. More precisely, we determine asymptotic formulas for the number of
reducible $\operatorname{SL}_N(\mathbb{Z})$-orbits on $\mathbb{Z}^2
\otimes_{\mathbb{Z}} \operatorname{Sym}^2 \mathbb{Z}^N$ satisfying general
infinite sets of congruence conditions.
