Molecular nitrogen is a spin singlet (and so diamagnetic) and molecular oxygen is a spin triplet (and so paramagnetic).
The figure below taken from Atkins' Physical Chemistry (Figure 10.33 of the ninth edition) illustrates the comparative molecular orbital electronic structure. The key difference is that the two valence electrons in oxygen are in two degenerate pi_g orbitals. Hund's rule coupling then causes the ground state to be a spin triplet. There is a large Curie paramagnetism associated with that.
A nice discussion of the relevant two-site two-orbital Hubbard model is here.