Dear student
Ionic compounds are formed by the transfer of electron. Thus, there is separation of charges which makes it polar. As we know, '' like dissolves like''. Therefore polar molecules like ionic compound will dissolve in polar solvent, here water. Ionic compound will remain insoluble in non-polar solvent.
Regards