Oxygen molecule (O2): Each oxygen atom has 8 electrons. Hence, O2 molecule has a total of 16 electrons. The electronic configuration of O2 molecule therefore is:
O2:(σ1s)2(σ∗1s)2(σ2s)2(σ∗2s)2(σ2pz)2(π2px)2 = (π2py)2(π∗2px)1 = (π∗2py)1
As we can see from the above electronic configuration, there are two unpaired electrons in the antibonding molecular π-orbital which leads to oxygen exhibiting paramagnetic properties.