What I've always wondered is why women are embarrassed to get caught in a brassier and panties but wear skimpier bikinis to the beach.
because most people like to abide to dress codes, to break the dress code would induce embarrassment or uncomfortableness. generally in most public situations, being in a bra/panty is not a social norm and the person doing it would risk being Othered or otherwise avoided, or damage her social reputation. it is accepted to wear bikinis on beaches because there is a practical purpose for it, and everyone does it.
because being the only person naked in a situation is a vulnerable position. not in terms of physical (for fear of social reprimand will prevent a person from taking advantage of a naked woman), but in terms of psychological/social reasons, such as the male gaze. a naked person in an unexpected situation is often considered to be submissive, inferior (note: 'naked' is not to be confused with 'nude').
similar rules exist for males too, though. if a male were to suddenly lose his clothes in the workplace he would find himself in a most deplorable state as well.