Besides the obvious storytelling reason that it's required to horrify the reader and drive tension, I've never been able to get my head around why Gilead requires handmaids to live with their couple and actually have sex. Wouldn't it be more dignified for everyone to have some mechanical go-between? Not to mention that a method that didn't intrude into an existing marriage could probably happen more than once a month, which is a super inefficient way to get pregnant.
It's important to note that the rulers of Gilead are the Christian equivalent of the Taliban, religious crazies enjoying total theonomic rule over the nation. In order to cope with falling fertility, the upper classes co-opt lower class females to act as broodmothers for their children, referencing the story of Jacob as their justification.
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.
Would it be easier to use turkey basters? Sure, but it wouldn't be the Christian way. It would be an offense to God. The fake "Historical Notes on Gilead" at the end of the source novel show that this was considered but ultimately rejected as irreligious.
The need for what I may call birth services was already recognized in the pre-Gilead period, where it was being inadequately met by “artificial insemination,” “fertility clinics,” and the use of “surrogate mothers,” who were hired for the purpose. Gilead outlawed the first two as irreligious, but legitimized and enforced the third, which was considered to have biblical precedents; they thus replaced the serial polygamy common in the pre-Gilead period with the older form of simultaneous polygamy practised both in early Old Testament times and in the former State of Utah in the nineteenth century.
For the male rulers of the Republic of Gilead, the desire for children is an important part of their reproductive program. However, it is clearly not the only only reason (or maybe even the main reason) for what they do. A lot of what the masters of the new theocracy do is primarily about power. The sex is, to a significant extent, only secondary. The whole household ritual, with bible readings and prayers, before the commander starts "fucking*... the lower part of [the handmaid's] body" while the wife cradles her head, is designed to put as much focus as possible on the man. The whole process is designed to be demeaning to both women. The handmaid is in most cases being raped, while the wife has to sit through the whole thing, repeatedly reminded that that the it is all her fault for being barren.
For Commander Fred, there is another clear advantage of the system. While Offred indicates that he does not particularly seem to enjoy the sex act, he certainly enjoys having what amounts to a second, much younger wife. He invites her to his office to talk and eventually out for an excursion to the local brothel. She is desperate for any assistance he can provide in locating her husband and (especially) her daughter; and he knows this and enjoys taking advantage of her supplicative behavior.
The specific theological justification offered by the rules of Gilead goes back to the patriarchal culture of the Book of Genesis. When the wives of the Hebrew patriarchs had trouble bearing children, the men fathered children by their wives' maids instead. This happened in the stories both of Abraham (who fathered Ishmael by Hagar, while his wife Sarah remained barren) and Jacob (who fathered children by his two wives Rachel and Leah and each of the wives' handmaids, Bilhah and Zilpah). More generally, the the Bronze-Age cultures of the Biblical patriarchs that was profoundly male-dominated, and the founders of Gilead tried to emulate that. (For comparison, in Mycenaean Greece, another Mediterranean culture from the second millennium B.C.E., all of a king/chieftain/sheik's female slaves were explicitly expected to serve as concubines. The Odyssey makes a great deal of Odysseus's marital fidelity; when he was home in Ithaca, he did not have sex with any of the palace slaves.)
It is also important to keep in mind the historical context of the novel. The Republic of Gilead is an outgrowth of the 1980s American religious right. (The book includes specific flashbacks satirizing the cooperation between far right conservatives and anti-pornography feminists like Offred's mother.) In the 1970s and 1980s, many religious conservatives were almost as strongly opposed to artificial insemination methods as they were to birth control. Many believed that reproduction was only supposed to occur through purely natural methods: intercourse between and man and woman, followed by natural gestation. Any procedures that modified this formula: fertility treatments, artificial insemination, contraception, and abortion, were vilified to varying extents. So it is natural that the rulers of Gilead insistent on a purely "biological" reproductive methodology.
*Offred is emphatic that "fucking" is the only correct word to describe the act involved.
"Why does the Handmaid's Tale have rape"
They don't. Lets review what it says in the book:
“Below me, the Commander is fucking. What he is fucking is the lower part of my body. I do not say making love, because this is not what he’s doing. Copulating too would be inaccurate […]; Nor does rape cover it: nothing is going on here that I didn’t sign up for”
Offred, while it's probably not her favourite activity, says very clearly she does not consider her lord and master's activities to be rape.
Legally, rape is intercourse without consent. In Gilead, handmaids do not have a right of consent, refusal or really much of anything - other than the right to remain silent while any of the above is going on. Refusing to put out on demand will likely result in an immediate "attitude adjustment" (in the form of a good solid backhand), and if the handmaid's attitude does not in fact promptly improve the state has much more severe penalties available.
Practically, artificial insemination has a much lower success rate and requires a lot more specialized equipment than the natural method. In a society where the opinions of the woman involved count for exactly nothing it is simply easier and cheaper to send her over to the donor at the right time. In an ultra-fundamentalist society there would be substantial resistance to use of technology here.