A state of being filthy, grimy, or otherwise unclean is dirtiness. If your parents are constantly complaining about the dirtiness of your room, you might want to stop eating potato chips in bed and leaving your grubby socks all over the floor.
If dirtiness drives you crazy, you probably sweep frequently; perhaps you've even purchased in a robot vacuum that's constantly rolling around your house sucking up dirt. On a larger scale, if the dirtiness of the oceans is something that concerns you, you might choose to study environmental science so you can try to do something about it. Dirtiness comes from dirt and its Old English root meaning "any foul or filthy substance."