Let me tell you a little about the anomalous expansion of water. A block of solid form of most substances will sink in their liquid form but ice floats on water? Why?
It is because of the abnormal or anomalous behavior of water when it is cooled. When cooled from room temperature liquid water becomes increasingly dense, as with other substances, but at approximately 4 degrees C (39 degrees F), pure water reaches its maximum density. As it is cooled further, it expands to become less dense and this is called anomalous expansion of water which makes ice less dense than water.
That was the scientific reason. A divine reason for the same phenomenon would be that this happens so that the aquatic life in cold countries could survive. Ice, being less dense, forms a layer over water and prevents the temperature of water beneath it from becoming too less for the aquatic life to survive.