For the 2nd IE of Na an electron is being removed from the 2p subshell.For the 2nd IE of Mg an electron is being removed from the 3s subshell.It requires more energy to remove an electron from a lower energy shell. The shielding on the electron is greater in Mg+.