Most objects do expand when heated although there are some exceptions. Remember, that density equals mass divided by volume. Heating an object does not change the mass of the substance, only the volume.
density = mass / volume
If the mass is constant and the volume increases, then the density will decrease. If the volume decreases with an increase in temperature, then the density will increase. Density is a property of a substance that can be used to help identify it but it is necessary to use references values at the appropriate temperature so that we can compare experimental results with accepted values.