The Earth's atmosphere plays a crucial role in maintaining it's temperature at habitable levels. This occurs because unlike the moon, which doesn't have an atmosphere, our's acts like a blanket covering the Earth and trapping in heat which warms the ground and maintains warmer temperature's at night. At the same time the greenhouse gases that get trapped in the Atmosphere prevent too much of the sun's radiation from passing through and thus maintains cooler temperatures during the day than the moon.