Sex is a fun for poor people. As world is getting richer, there is much more to do than just make babies.
We are always looking for societal explanations and ignore possible effects of biology / chemistry. It is unpleasant to realize that we are biological machines that are fairly resilient, but will still break down or malfunction in certain environment.
People in rich countries still have less babies, but those that afford it have more.
https://www.statista.com/statistics/241530/birth-rate-by-fam...