Because ice has a lower density than water. This is one of the greatest exemptions to the rule, "a substance expands when heated, and contracts when cooled." Water expands as it turns to ice.
(on cooling it contracts only till 4 degrees. if cooled further it starts expanding at 0 degrees it forms ice)
Since it expands, it has the same mass (same amount of water particles) occupying a larger volume. Thus, its density decreases.