Short-range antiferromagnetic correlations are known to open a spin gap in the repulsive Hubbard model on ladders with $M$ legs, when $M$ is even. We show that the spin gap originates from the formation of correlated pairs of electrons with opposite spin, captured by the hidden ordering of a spin-parity operator. Since both spin gap and parity vanish in the two-dimensional limit, we introduce the fractional generalization of spin parity and prove that it remains finite in the thermodynamic limit. Our results are based upon variational wave functions and Monte Carlo calculations: performing a finite size-scaling analysis with growing $M$, we show that the doping region where the parity is finite coincides with the range in which superconductivity is observed in two spatial dimensions. Our observations support the idea that superconductivity emerges out of spin gapped phases on ladders, driven by a spin-pairing mechanism, in which the ordering is conveniently captured by the finiteness of the fractional spin-parity operator.