Valence bond theory predicts that all electrons in diatomic oxygen are spin paired, making O2 diamagnetic. However, we know that diatomic oxygen is paramagnetic. This means that electrons are not spin paired.
If we apply valence bond theory, each oxygen in O2 looks like this:
2p _e-/e-_ _e-_ _e-_ (remember that electrons, when paired, spin in opposite directions and are drawn as arrows pointing up/down)
1s _e-/e- (usually not shown because only valence electrons are considered)
This is because oxygen has the atomic number 8 and therefore has 6 valence electrons (the other 2 are in the first shell of the atom). The 1s shell represents this first shell. The second shell includes one "s" and 3 "p" orbitals. The s orbitals must be filled with spin paired electrons first and then the ones that are left over are used to fill the 3 p orbitals. We start by putting one electron in each of the p orbitals. This uses three of the four electrons that we still have to place. The last one becomes spin paired with the electron in the first p orbital to fill that orbital. The other two p orbitals contain unpaired electrons.
Using valence bond theory, you would predict that because each oxygen has those 2 unpaired electrons in their p orbitals, the two oxygens would form a covalent (double) bond and each would share their two unpaired electrons to fill their p orbitals leaving no unpaired electrons and making O2 diamagnetic. This isn't the case, of course.
O2 is paramagnetic with unpaired electrons. One must apply molecular orbital theory to understand why. This goes a step beyond valence bond theory.
We know that with O2 we have four total electrons in the "2s" orbitals (2 from each oxygen). These electrons are going to form something called sigma bonds. When you diagram molecular orbitals, there are both bonding and antibonding orbitals that must be drawn. These 4 "2s" electrons are going to be split into 1 bonding sigma orbital (2 electrons) and 1 antibonding sigma orbital (2 electrons).
We then move on to the "2p" orbitals. Each oxygen has 4 "2p" electrons. These electrons are going to go into sigma and pi bonds. When you diagram this, you have two pi bonding orbitals and one sigma bonding orbital and then corresponding higher energy (filled after low energy bonding orbitals) pi (2) antibonding orbitals and one antibonding sigma orbital.
Again, you use the "2p" electrons from both oxygens to fill these molecular orbitals. You start out by using 4 of the 8 "2p" electrons to fill the two bonding pi orbitals and then 2 more to fill the one bonding sigma orbital. This leaves 2 electrons. They are added to the higher energy antibonding pi orbitals (you'll see them as pi star).
One electron is added to each pi orbital so there are 2, unpaired electrons in the antibonding pi orbitals. This is where the paramagnetic behavior of O2 comes from. Whereas valence bonding theory predicts that all electrons will be paired, using the molecular orbital theory, you can see that there are unpaired electrons making O2 paramagnetic.