The difference in speed is due to the different densities of the two mediums.
In fact, the higher the density of the medium, the greater the speed of sound. Sound travels faster in liquids (e.g. water) than in gases (e.g. air) because liquids are more dense than gases. This is due to the fact that in liquids, molecules are closer to each other, and since sound is essemptially vibration of molecules, these vibrations are transmitted faster from molecule to molecule in a more dense medium (such as a liquid) rather than in a less dense medium (such as a gas)