Well, just imagine that the Mg=O bond has too much strength to be dissolved by water or is more stable than aqueous Mg2+ ion.
Depends on several chemist factors such polarity, electronegativity difference, cell structure, bond distance, cation/anion size, lattice energy etc.