Because the thermometer which is used to measure the air temperature that is a mercury thermometer.
There are four following dos and don'ts when you measure the air temperature:
1)The mercury thermometer should hang in the air to prevent to touch the ground or other objects;
2)The thermometer should keep dry instead of dip in water or other liquids;
3) The air temperature value should be read after the thermometer gives a stable one;
4)Don’t expose the mercury thermometer in the sunshine.
Mercury-in-glass thermometer - Wikipedia