This is very simple and very obvious but it helps explain the Bible.
Imagine a world with no birth control. Or concept of it. Imagine a world where babies are a burden on a society and individuals - especially unwanted babies.
In that world a sensible idea would be to not have sex unless you are able to take care of the baby that might arrive from sex.
Now imagine a world where sensible ideas are usually enforced by tying them to a god and probably a punishment from a god for not following the rule.
Jesus, in my opinion tried to correct this by saying that it's not really about having sex or not but about humanizing women but the church sorta missed that. Instead the church banned birth control and continued to tie punishment from a god (or the god's followers) to the rule while also dehumanizing women the whole time.
The Bible isn't nearly as primitive as many of its followers.