Human beings, like most species, have a strong sex drive because, in the primal hunter-gatherer state, it was optimal to conceive as much as possible. A female might only have 10 years of sexual maturity, and many of her offspring would die off. As human lifespan increased and child deaths decreased, it was possible to conceive many more children than one could support.
Various factors, from religion to social shaming, evolved to control unrestrained sex. The act became a “savage”, carnal thing that needed to happen behind drawn curtains but was fundamentally inappropriate for civilized people. It was not something to be done without restrictions and consequences.
The advent of widespread contraception in the 20th century meant that the taboos intended to restrict childbearing no longer applied to sex. The idea of the sexual revolution was that sex could be enjoyed for its own sake, free of any societal shackles. However, culture is deeply rooted. It may take more than two generations to fully debunk the view of sex as a somewhat shameful, secretive thing.
It has been said that sex is considered to be taboo because even with all the modernity of life, it reminds people that they have a basic core need that somewhat makes them animalistic. A lot of humans would like to believe that they are better than all of the other animals here on earth.
Since sex is done by almost all living things, they feel that they are being compared to other living things that they consider “lower” than their capacity. Another reason is that of religion. Religious people feel that it is inappropriate to talk about sex whether they are married or not. Talking about sex now may be done by friends who are close to each other.