They are created male and female at the same time.
Likewise, flesh is not just pointing us to the outer layer of skin over the skeleton of a human being.
To claim that these laws "were not instituted until thousands of years later" is simply not true -- and this includes the sexual laws found in Leviticus 18.