Heat produces infrared per surface area.
Objects in the shadow retain heat from the daylight sun, and since you're close to them the heat per area squared is much higher.
The moon is far far away, and following the inverse squared law, any infrared emitted by it's surface has been spread far and wide with your sensor only picking up a tiny fraction of the infrared.