The atmosphere acts as a blanket, trapping heat through the greenhouse effect. Without it, the Earth would radiate heat into space much more efficiently, leading to extremely cold temperatures, especially at night.