Why is #M(g) + Delta rarr M^(+)(g) + e^(-)# the ionization energy of magnesium?
Because that's how we specify the ionization energy.
Ionization energies are the energy associated with the formation of one mole of gaseous cations, and one mole of gaseous electrons, from one mole of gaseous atoms:
Such a specification allows us to compare electronic structure on the basis of atoms, which allows an insight to atomic structure and energy levels, rather than the structure of a solid material. It is well know that ionization energies INCREASE across a Period (from left to right as we face the Table) and DECREASE down a Group.