Dr. Hugh Ross of Reasons to Believe has a good answer. He says, “Given that we are all descended from Adam and Eve, either Cain or one of his brothers must have married a sister. This would seem to violate the commands recorded in the book of Leviticus forbidding marriage between brothers and sisters. The Levitical laws, however, must be considered in their proper historical context. Though the book of Genesis condemns sexual relations between children and their parents, it nowhere prohibits a man from marrying his sister or niece. Abraham, for example, married his half-sister without compunction. Not until the time of Moses were laws established forbidding a man from marrying a sister or niece. The timing of this command makes perfect sense biologically, for genetic defects as a result of intra-family marriage would not begin to crop up until after the first few dozen generations.”
In a nutshell, though sex between parents and their children has always been out of the question, marriage between other close relatives was permitted until the time of Moses. Practically, this makes sense because as Adam and Eve’s offspring married each other the human population possibly grew to almost 5 billion within a generation (see article mentioned above)! Scientifically, this make sense in terms of the genetic defects that would have begun to arise on a grand scale if new restrictions had not been put in place. This is a good example of one of God’s moral laws (and its timing) making very good scientific sense.