It is not due to "genetic" reasons since it has was forbidden in most places much before people even knew what "genes" were. I also doubt they could see a pattern between some birth defects and siblins relations. You also have to remember incest is not that uncommon. It happened in Europe royalty not too long ago. The main reason, I think, was probably to avoid disputes over sex and marriage inside the same family/clan. By not allowing sex within the family you avoid disputes between father/son, brother/brother and manages to merge two families or clan by having 2 of each family have sex/marriege. And of course, in our society (European-American), Christianity included the whole "sin" and "god" thing in it.
Also, this whole "your son will come out retarded" is really exagerated. As someone already mentioned, the rates of birth problems aren't that much higher than normal rates. the chance of an older couple having a child and it having problems is higher than 2 young siblings.
So, It probably started to stop disputes within the own clan and encourage clan merging, then it became a sin to god just to avoid people to having sex at all (in a world where you can not have sex with your own family or anyone else besides your wife/husband, people have very little sex. And thus being miserable and increasing their desperation and the feeling of a need of god/religion), and then came capitalism which also prohibit it because of property. A daughter must be virgin to make sure your fortune will be going to someone you want (your legit daughter's son for example) and to also encourage the merging of 2 rich families.







