When hot water comes out of a tap cloudy, it is due to tiny air bubbles that get trapped in the water. This happens due to changes in either temperature or pressure.
Cloudy water is most common when it is cold outside, as cold water is able to carry more air than warm water. However, as the water heats up while travelling through the pipes to the tap, the temperature change causes some of the air molecules to be released from the solution. This in turn forms the millions of tiny air bubbles that turn the water a white or cloudy color. It is perfectly safe to drink this water, as the air bubbles are completely harmless.