Actually it doesn't. In the planar molecule the
A diagram of the molecular orbitals is given here. Note that the
It is a consequence of both Hund's rule of maximum multiplicity (which gives oxygen two unpaired electrons) and achievement of maximum separation of the orbitals.
Following Hunds rule electronic configuration of oxygen is
Oxygen, therefore, has two unpaired electrons which can bond with the two hydrogen atoms. In order to obtain maximum separation of the electron orbitals from the 3 atoms, bonding is achieved by the formation of four