You shall not commit adultery.
This is one commandment more honored in the violation than in the keeping. The Suzerain is not amused when people break faith. We are not animals operating with no moral compass, but bear a heavy obligation to uphold the needs of our extended family community over our particular appetites. Sexual fulfillment is not a sacred right.
Nor is this a demand you view sex merely as an act of procreation. However, you cannot separate the two. It’s bad enough we carry the Western mythology that romantic love is mysteriously overpowering, but we don’t even have much of that these days. It’s just a form of recreation, detached from any other reality.
Notice here the issue is not sex out of wedlock, but sex which interferes with the marriage bond. Nor is it simply a matter ancient women were mere property in themselves. Rather, their sexual favors were a property right, as were the man’s. Sex meant making babies, and God says babies need the full support of their entire village — which always meant your extended family household. So you don’t upset things by getting your cousin’s wife/daughter/etc. pregnant without that lifelong commitment. Same goes if you spot some gal/guy from another clan or even another nation. Proper social stability was not possible without honoring commitments between persons. Obviously, prostitution is also a sin, regardless, but the Old Testament narrative seldom bothered to condemn the obvious.
God has distinct notions about this, and He knows what is best. Reading between the lines, we note idolatry and adultery don’t simply sound similar in English, but they are morally related. If you try to quibble on God’s requirements, you are a moral adulterer, as the Suzerain is the husband who marries the nation as His bride. The Hebrew death penalty on adultery applied to both sexes, but in spiritual terms, you are dead already if you can play around on God.