Because in any surgery the room is sterile. The doctor's, rsn's and everyone else along with the tools are sterile. Having on a pair of underwear close to the incision site is unsterile. It also depends on the hospital and who is preforming the surgery. Say you are having leg surgery and you're a female. You may be able to wear a clean bra provided by the hospital or one from home... But that's Because it will be far from the incision site.
Hope this answers your question!