Density of a substance is given by a formula
Density = Mass/Volume
In case of solids the molecules are tightly packed and hence large mass is concentrated in very small volume. Hence their density is more. But in case of liquids and gases, their molecules have intermolecular space and hence they don’t have large mass concentrated in small volume. So the density of solids is generally more than that of the liquids and gases.