if people aren't ashamed of themselves how are they going to do what they are told by people who aren't?
some thoughts on
ego and
psychology. fear of rejection is the basis not only for sexual shame, guilt etc but also for many other social pathologies like not challenging each other's ideas, submitting to arbitrary authority and so forth. lots of enforcers go around delivering the message "think before you speak" etc and overtly appealing to fear of rejection.
suspect it played an essential role in the evolution of hominid bands into humans by cementing social cohesion and the ability to function as a band since groups cannot function if the individual members don't care about being rejected. however its opposite also plays an essential function in enabling adaptation to changed conditions.
bands with less fear of rejection might have been less likely to survive in a given environment than bands where members feared the rejection that results from disapproval of not behaving like everyone else - following well established traditions that had been proved to work. but bands with more fear of rejection might have been less likely to adapt rapidly to changed conditions.
primarily social rather than biological phenomenon since it clearly varies in different cultures and epochs with the same human biology. but the connection with sex is interesting in demonstrating the contradictory dynamics. people with less fear of rejection influence the future more both directly by influencing others and via sex in being more likely to reproduce.