In group 2 elements, the reactivity is a measure of how easily the atoms lose outer shell electrons. An atom at the top of the group, such as magnesium, has less shells meaning the atomic radius is smaller, and the net attractive force from the nucleus on the outer shell electrons is greater, meaning it's harder to lose electrons to a halogen, i.e., it's less reactive. An atom at the bottom of the group, such as barium, is more reactive. This is because although the proton number has increased, increasing the attraction the nucleus has for outer shell electrons, the number of shells has also increased significantly. As a result, the electron shielding is far greater so the nuclear force exerted on outer shell electrons is weaker, and so it's easier for a halogen to take them in a reaction.