Entropy is a measure of unavailability of thermal energy of any system for performing mechanical work. It also represents the randomness of the system.
As the randomness of any system increases entropy also increases.
When Mg+2 are hydrated, Mg+2 ions come from the orderly lattice to disorder state. As the randomness increases, entropy also increases.
Thus after hydration of Mg2+ entropy increases.