J.R. S. answered 03/17/20
Ph.D. University Professor with 10+ years Tutoring Experience
Let's look at the electron configuration for the two metals in the ground state:
Mg: 1s2 2s2 2p6 3s2
Al: 1s2 2s2 2p6 3s2 3p1
The first ionization will remove the outer most valence electron leaving...
Mg: 1s2 2s2 2p6 3s1 (Mg+)
Al: 1s2 2s2 2p6 3s2 (Al+)
Note that Al now has a complete 3s subshell whereas Mg can still easily lose the remaining 3s1 electron in order to obtain a complete 2p subshell. It would be very difficult to remove the 3s2 electron from the Al (2nd ionization) but not so difficult to remove the 3s1 from Mg. Thus the 2nd ionization energy for Mg is lower than that for Al.