I also think that choice is reflected in basically the entirety of M*A*S*H, beyond just the moments surrounding gay/homophobic/gender-non-conforming characters, which is part of what makes the show as funny as it is a lot of the time.
So many of the best gags (at least in my opinion) in M*A*S*H result from the explicit subversion of audience expectations of how a character will react to a given situation. To me, the way Klinger is reprimanded for how he dresses, and the ways he reacts to them, are the inverse of the scenes where the camp is being shelled, but because of the bureaucracy of the army, they’re told they are not being shelled.
The expected reaction in both of these situations from the audience’s perspective is fairly clear. Kilnger will be shamed for wearing women’s clothes, and the shelling will either stop, or at least the person on the phone would be apologetic and frantic. But neither of these happen, and the scenes are funnier for it. They pull the rug out from under the audience in a way that make the whole thing funnier, because they don’t go for the obvious joke.
On top of that, this style of humour also helps create the sense of alienation in the audience that the characters are also feeling. Klinger being reprimanded for being out of uniform rather than being shamed for crossdressing throws us off of what we at home are primed to expect from a situation, and helps establish just how strange and different being in or around the Korean War, the military, or conflict in general can feel. Same with the shelling sequence.
The Late Doctor Pierce uses this concept for the entire episode, and uses it both for humour and for pathos. Ultimately, I think this subversion of expectations is what makes M*A*S*H so funny and so charged while not (or at least not always) coming off as preachy, and why the show has endured so long.