Why do commercial aircraft allow the pilot to turn off the transponder? Under what circumstances would you 'not' want it to transmit?
All electronics, apart from the "black box" are under pilot control. So, anything besides the box can be turned off including the transponder.
The transponder broadcasts a code within a time period after being interrogated by ground radar, which aids ground control operations. The code can be set by the pilot and the code can be piggybacked with a report of current altitude, if the device is mode C capable. They also have and ident button, which when pressed sends an ident code, that show up on radar screens as ident. This differentiates it on controller's screens from others in the area that may be sqawking the same general code.
her is also a mode S type which also broadcasts aircraft registration number.
I think the most probable cause of the pilot turning it off is with an equipment failure of some kind; incorrect altitude reporting, or inability to select the correct code for broadcast.
Not many desirable reasons to be seen as only a blip on the screen, besides attempted stealth.