Of course, religion is a factor. But why do some religious traditions find the open display of sexuality to be shameful?
Plausibly, it's because of jealous lovers. A wife does not want her husband cheating on her, because this could lead to her husband being less devoted to her and to their children, providing less affection and fewer resources for them, and more devoted to the other woman he's seeing. If public display of sexuality is considered shameful, the husband would have fewer temptations and opportunities to cheat. Like the Dolly Parton song, Jolene, in which she is worried about an attractive woman tempting her husband - "I'm begging of you, please don't take my man."
Similarly, the husband does not want his wife cheating on him, for the same reason and also because he might end up raising children who don't share his genes. So he wouldn't want her showing off to other men either, though he might be indifferent or approving of other women doing so.
Open sexuality might also lead to more teen pregnancies, especially in times before easy access to contraceptives. Those times were also poorer times, so the woman and her child could have a very hard life as a result, especially if the young and irresponsible father does not help.
There is also the concern of spreading STDs, again more important in times before access to condoms and antibiotics.
So there are some reasons why people would want to suppress sexuality except under controlled circumstances. Some of these reasons are, in part, cultural holdovers from earlier times. In modern times, with modern contraceptives and medical knowledge as well as greater social support systems, some of these reasons are less relevant.
We also must balance these concerns against the individual right of men and women to do with their bodies as they please. If one person wants a second person to hide their sexuality, what obligation does this create (if any) for the second person to do so? It's their body.