Sexual and taboo topics have always been a part of music. The lyrics are there, but you just aren’t picking up on all the slang and innuendo because you’re listening with modern ears.
In “Minnie the Moocher” Cab Calloway sings about a woman who falls for a cokehead who gets her hooked on opium and turns her into a prostitute. While released in 1931, it’s based on an even older song written some 30 years before.
Recorded in 1937, Robert Johnson’s “Travelling Riverside Blues”, is just the singer discussing all the women he’s slept with, graphically ending the song asking for a woman to jerk him off until come runs down his leg.
When Howlin’ Wolf sang in the ‘60s that he was “built for comfort, not for speed”, it was very obvious he’s talking about the bedroom. When he talked about “another mule kickin’ in your stall,” he was using it as a metaphor to describe being out of the house and another man coming in to have sex with your woman.
The 1971 T-Rex song “Bang a Gong” is specifically using a phrase that means “to do cocaine” while the Symphonie Fantastique by Berlioz, written 140 years before that is about smoking opium.
So darker topics have always been there. The phrase we use to describe a whole genre of music, “rock and roll”, was originally a slang term which just meant “to have sex”. While there is an argument to be made that sex in music has become more explicit and accepted over time (especially music made post 2 Live Crew), I would actually say that it’s merely a change in the linguistic norms of popular culture being reflected by the music. For example - if I were to go back to 1920’s Mississippi and say to a woman, “I’m horny, how about a blow job?” - she would have no idea what I was talking about. And if tomorrow I asked my girlfriend to “squeeze my lemon” she would be just as confused as that hypothetical woman in the past.
Humans have always had our baser instincts, and we have expressed these passions from time immemorial. James Joyce wrote some insanely filthy letters and his wife, which you can read online. Mozart wrote a song called “Lick Me In The Ass”. And the Roman poet Catallus has a poem known by its repeated phrase “I will fuck you in the ass, and then face-fuck you.”