Dear student,
Solids are denser as the intermolecular force of attraction between the particles is more and they are packed tightly. So the density is more for solids. Whereas in liquids and gases this intermolecular force is somewhat less and they are less denser than the solids.
Regards