Here's why:
* Density is a measure of how much mass is contained in a given volume.
* Temperature and pressure affect the volume of a substance. For example, if you heat a substance, it will expand and occupy a larger volume.
* However, the mass of the substance remains the same.
Therefore, if you have three samples of the same substance at the same temperature and pressure, they will all have the same volume (due to the same conditions) and the same mass (because it's the same substance). Since density is mass divided by volume, they will have the same density.