The melting phase transition transforms the long-range ordered-crystalline solid structure into the short-range-ordered average liquid structure. Looking at the process from the solid side, melting can be seen as the dramatic effect of a collective building-up of defects in the solid over a limited interval of temperature, eventually destroying the long-range order at the melting point.
The change of density accompanying the melting can be explained in terms of the kind of dominant defects, and these, in turn, depend on the solid structure. In particular, materials characterized by almost isotropic interactions between the molecules crystallize into compact three-dimensional structures, like the face-centered cubic (fcc) structure. In such a case, the dominant effect of the exponential growth of defects at the melting transition is a sudden decrease of density going from the solid to the liquid.
The situation is reversed in materials like water and elements like Bismuth or Silicon, where the molecular or atomic interactions are highly anisotropic. In the case of water, the shape of the molecule, and the important role of the hydrogen bond favor an open structure of the crystal in the same way as the anisotropic interaction between Silicon atoms favors the open diamond structure. At the melting point, the most frequent defects in such open structures induce a local and global collapse of the crystal structure, creating the conditions for a liquid phase at a higher density than the coexisting solid.
In summary, the reason for the increase of density at the melting point of some materials like water can be traced back to the presence of dominant anisotropic interactions favoring open crystalline structure in the solid phase.