The coldhead of one of these sensors (MIRI) functions optimally at temperatures
less than 7˚K (i.e. 7˚ above absolute 0). The other sensors run at temperatures under 40˚K.
For reference, the melting point of nitrogen is, 63˚K.
Any sunlight at all would overwhelm this sensor and severely reduce the operational lifetime (and results!) of the telescope.
At L2, the telescope has the sun and the Earth behind a layered sunshield. It's easier to maintain position there and to have both objects always in the sol-ward direction while looking outwards.