The density ,the volumetric mass density , of a substance is its mass per unit volume. So, basically density is the ratio of mass to volume. The ratio is always same in unit cell level to substance level.That is why density of unit cell is same as the density of substance.