It depends on the structure of energy levels. This is a comparation between energy level gap and electron pair energy. electrons prefer to stay separately instead of coupled way (Hund's Law). Therefore, If the gap between HOMO and LUMO of singlet is smaller than the pair energy, electrons at HOMO will occupy different orbitals (like oxygen and many metal ions). If not, singlet will be more stable.