Let me break it down:
The original line goes "A man shall not lie with another while he lies with a woman." (or something along those lines)
They said this because the greeks were super gay (Probably the first ones to do it) but if you're gay, you can't produce offspring, so they would marry a woman, and cheat on them with a man.
So it doesn't matter if you marry boy or girl, so long as you dedicate yourself to them.