Why do only some metals make protective oxide layers?
The simple answer is that metals which form sufficiently insoluble oxide layers stifle the very process which caused the oxide layer in the first place.
It's not just a matter of energy of formation of the oxide, but whether the first reaction product formed will be soluble or insoluble, then whether it will be adherent or non-adherent. In the case of the alkali metals, the oxide may be adherent (reaction with oxygen produces a layer that sticks), but is so soluble that it dissolves in water and refreshes the metallic surface. Likewise in the case of the alkaline earth metals - even $\ce{CaO}$, which is almost insoluble, is soluble enough to give a pH of 12.5, and soluble enough to be non-protective.
Now, magnesium oxide is quite insoluble, but probably is on the surface as $\ce{Mg(OH)2}$, a secondary product. You might consider that $\ce{Mg(OH)2}$ is $\ce{MgO}$'s failed attempt to dissolve and go away from the surface. Instead, it precipitates, and not only that, it adheres quite well. So further reaction with water is inhibited. However, if you heat the water, the $\ce{Mg(OH)2}$ becomes more soluble, and corrosion proceeds, although not as fast as sodium reacts. In flowing hot water, where the $\ce{Mg(OH)2}$ could be carried away, corrosion would be faster; in a flask, stirring would exert a similar rate increase.
The effectiveness of $\ce{Mg(OH)2}$ as a stifling passivator may be related to its layer structure:
 (File from Commons, by User:Smokefoot)

Like a clay layer, the hydroxide ions fuzz out of each layer of close-packed magnesium ions, and the metal surface could be like a half-layer of $\ce{Mg(OH)2}$, with $\ce{OH-}$ ions sticking out and bonding to separate layers of $\ce{Mg(OH)2}$, or perhaps the metal itself just hold onto a layer of $\ce{Mg(OH)2}$ - or maybe a little of both. This adherence is necessary to stifle corrosion. The clay layer-like characteristics of $\ce{Mg(OH)2}$ are also evident in milk of magnesia, which is a stable suspension - if the suspension were not stabilized by clay-like interactions, it would settle fairly rapidly and need good shaking before use. (I shake it anyway.)
Corrosion on aluminium is stifled by an adherent, quite insoluble oxide, but not completely: the oxide layer continues to thicken, and corrosion continues, diminishing, but never stopping completely. Nature never sleeps.
Iron rusts with $\ce{H2O}$. Iron oxide could be adherent (it is on stainless steels, when mixed with some chromium), but unfortunately, pure iron oxide tends to form a hydrate which has a greater volume than the oxide, and as it forms, it peels away from the metal surface, leaving bare metal or a very thin layer of oxide, which can still corrode. Chloride ion is especially effective in promoting the continuation of corrosion on iron and steel (even stainless) and aluminium.