This is because in space there are no gases to trap heat or to maintain a particular temperature by stopping the harmful radiations of the sun. So if no atmosphere would have been there on earth, the region, where sunlight was going to fall, would have been heated to more than 100 degrees Celsius while the region away from the sun would have cooled down to -90 degrees Celsius.