A day on the moon lasts nearly 15 Earth days, during which the surface is constantly bombarded by sunlight and is frequently hot enough to boil water. Unimaginably cold nights also last about 15 Earth days. Inventing heating and cooling equipment that can operate under these conditions and producing enough energy to power it nonstop could prove an insurmountable barrier to lunar exploration or habitation. Solar power — NASA’s most common form of power generation — doesn’t work at night, after all.
(NASA currently has no plans to establish an exploration base camp or habitations on the moon.)
Building bases in the shadowed parts of these pits allows scientists to focus on other challenges, like growing food, providing oxygen for astronauts, gathering resources for experiments and expanding the base. The pits or caves would also offer some protection from cosmic rays, solar radiation and micrometeorites.
https://newsroom.ucla.edu/releases/places-on-moon-where-its-always-sweater-weather
