The ionisation energy of nitrogen is larger than that of oxygen because nitrogen has half-filled orbitals and thus, a more stable configuration. N(7)=1s2,2s2,2px1,2py2,2pz1
(half-filled, thus stable) O(8)=1s2,2s2,2px2,2py1,2pz1
(less stable)
Exactly half-filled and completely filled configuration have extra stability.