Leviticus 18:10

The nakedness of thy son’s daughter, or of thy daughter’s daughter, even their nakedness thou shalt not uncover: for theirs is thine own nakedness.

The Lord's prohibitions against uncovering nakedness include the ban on sexual conduct with a son's daughter or a daughter's daughter, for their nakedness is one's own nakedness. This command guards the family boundaries God established to preserve moral purity. To cross that boundary is sin. The same principle forbids improper sexual familiarity between men and women.