There is a common trick to make clear water ice is to boil pure water before freezing it.
Cloudy ice is caused by gases (mainly nitrogen and oxygen) dissolved in the water that comes out of solution when the water freezes. The small bubbles trapped in the ice cause the white appearance. Boiling the water removes the air dissolved in it, producing clear ice as a result. Assuming that other impurities don't produce the same cloudy effect.
During freezing, the ice layer starts at all sides of the cube and grows inward. Water molecules fit the crystal lattice and will adhere to it, other molecules won't (but if the ice grows faster than the gas molecules can diffuse away, they will get trapped). The concentration of gases (and other impurities) in the remaining liquid rises, the solution becomes supersaturated, microbubbles start forming. All these get trapped in the ice, giving it a milky appearance.
The Solubility of gas in liquid not only depends on temperature, but it is also directly proportional to the partial pressure of the gas. When boiling, the gas phase in contact with the water is no longer the air, but the water vapor (in the bubbles and close to the surface). In those bubbles the partial pressure of the gases will be close to zero, so gas molecules will still leave the liquid phase (and the increased surface area and the movement of the water speeds up the process), but hardly any will return. Given sufficient time, the water vapor will remove most of the gas. Boiling is basically the equivalent of degassing by purging: removing a gas (oxygen usually) from a solvent by bubbling an inert gas through it.