We cannot hear the sound produced on the moon from the surface of the earth because there is a vast empty space between the moon and the earth. No medium is present in that empty space. And as we know, sound does not travel in vacuum. It needs a medium to travel which can be solid, liquid or gas.