Maseb
The Merriam-Webster definition does hint about this being about the effect it could have on any children. My suspicion is that long, long ago, people observed that too much “keeping it in the family” lead to children with weird problems and, before anyone knew anything of DNA, assumed that God had cursed them for doing that. So, it became encoded in religion as a sin and, in times long before a secular state, made it into law in some places too.
Now, even though we understand what is happening, some people still go back to “it’s a sin” despite knowing that in their particular circumstances there is nothing to worry about.
Interestingly, there seems to be some natural defence in that children of the opposite sex that grow up very close together generally don’t fancy each other. Then, if we look at other species, we see that males often roam to find a mate and females stay home. Look at marriage traditions and, for a church wedding, it usually happens at the bride’s church.