This is how they justify it:
//The Handmaid's Tale sex ceremony uses a real Bible passage from The Old Testament as justification for the act.
Before the ritual takes place, the Commander reads from a translation of Genesis 30:1 found in the Kings James Bible:
And when Rachel saw that she bare Jacob no children, Rachel envied her sister; and said unto Jacob, Give me children, or else I die. And Jacob's anger was kindled against Rachel: and he said, Am I in God's stead, who hath withheld from thee the fruit of the womb? And she said, Behold my maid Bilhah, go in unto her; and she shall bear upon my knees, that I may also have children by her. And she gave him Bilhah her handmaid to wife: and Jacob went in unto her. And Bilhah conceived, and bare Jacob a son.//
https://www.bustle.com/p/the-bible-passage-in-the-handmaids-tale-sex-ceremony-has-ironic-meaning-53645