The reason lies in the fact that ionic substances are made of charged particles - ions. When the ionic solid is dissolved in water the ionic lattice breaks up and the ions become free to move around in the water. When you pass electricity through the ionic solution, the ions are able to carry the electric current because of their ability to move freely.
water becomes conducting due to that presence of a minute concentration of H+(aq) and OH-(aq) ions in the water. However, electrons cannot flow through water.
For eg:
HCl---> H+ + Cl-
ions H+ and Cl- are free to move in aqueous medium and thus conduct electricity.