Hawkeye made a bet that he could walk into the mess tent naked and no one would notice. When he walks into the mess tent, the camera shows a shot of him from the waist up, but if you look closely, you can see the top of his shorts or pants at the bottom of the screen.
The producers had to have Alan Alda wear shorts in this scene for reasons of decency. Can you imagine the trouble that CBS would have been in if part of Alan/Hawkeye's private parts had accidentally shown in this scene? What if one of the objects (wooden board, etc.) that conveniently covered Hawkeye's private parts had slipped for just a minute, and more of him showed than was supposed to show? At least he was wearing flesh-colored shorts, so that his shorts weren't too obvious in this scene.