The reason that water expands as it freezes is because of molecules in the frozen water that take a more defined shape and arrange themselves in six-sided crystalline structures.
When that water freezes and the above happens to it the waters crystalline arrangement is less dense than that of the molecules in liquid form which makes the ice less dense than the liquid.
The ice floats on top of the water as it expands the expansion of the frozen water is what actually pushes against water pipes and causes water pipes to burst when frozen.
So it's important to keep water faucets running at a slow rate to allow water to flow freely through the pipes to prevent it from freezing and expanding in the water pipes and bursting the water pipes.
Also the water molecules have slowed down enough that their attractions arrange them into fixed positions. Water molecules freeze in a hexagonal pattern and the molecules are further apart than they were in liquid.