Because of different values of hydration and lattice enthalpies.
Explanation:
For dissolution of a compound,its hydration enthalpy(for water as solvent) or solvation enthalpy should be greater than the compound's lattice enthalpy.
As all compounds have different lattice enthalpy,their dissolution is different.