Endogamy was the preferred practice in many parts of the ancient Near East;[1] the ideal marriage, in fact, was usually one to a cousin, and it was often forbidden for an eldest daughter to even marry outside of the family at all.
Biblical commentary on human sexual behaviour is less critical for events that are described as taking place before the Law of Moses was issued by God to the Israelites.
[1] The Hebrew Bible mentions a number of instances in which marriage and sexual intercourse occurs between close kin, mostly dated to before the Sinai period: Leviticus 18:7–11 and 20:11–21 sets out lists of prohibited relationships, and two chapters later specify punishments for such unions, but the second list of unions is much shorter than the first.
[31] The Talmud argues that the absence is because the prohibition was obvious, especially given the proscription against a relationship with a granddaughter,[32] although some biblical scholars have instead proposed that it was originally in the list, but was then accidentally left out from the copy on which modern versions of the text ultimately depend, due to a mistake by the scribe.
[33] The second list in the Holiness code noticeably differs from the first by not including the closer relatives, and it might be assumed that obviousness is the explanation here as well.