According to Business Insider, hot water, and therefore hot water pipes, freezes faster than cold water because of the Mpemba effect. Although it is not entirely understood why hot water freezes faster, scientists believe that the highly charged hydrogen bonds in water give it unique properties.
Some scientists doubt the validity of the theory that warmer water freezes faster than cooler water. They say that because hot water evaporates at a higher rate, less total water is available to freeze thus shortening the freezing process. Others say that dissolved gases in hot water release and subsequently make the water more viscous.