The whole idea that the act that caused the fall of man was sex isn’t new. It was already around since the second Temple period - the time of Jesus - actually.
The idea was, that Eve (the Jewish Rabbis were not too fond of Eve - they often fitted the Genesis story into the ‘killer wife’ motif, where the woman is responsible for the man’s downfall)
did have sex - not with Adam (who was obviously meant to be her natural partner), but with
the serpent. In other words, the fall of man was apparently caused by interspecies adultery.

To those people who thought that the serpent was somehow controlled by or was a manifestation of a fallen angel (Satan, Samael, etc.), this idea of Eve having sex with the serpent (= the fallen angel) sort of dovetails with Genesis 6, where the ‘daughters of men’ are said to have relations with the ‘sons of God’ (identified in an idea common at the time as fallen angels).
Some Jews speculated that the sentient serpent / the angel was infatuated with Eve and seduced her. (Apparently, this was triggered by the wording of Eve’s complaint in Genesis 3:13 - “The serpent deceived me,” and God’s statement in verse 15: “I will put enmity between you and the woman,” suggesting that there was no enmity between the two at this point yet.)
The apocryphal work 4 Maccabees (1st century AD) seem to reflect this whole idea of Eve having sex with the serpent in its retelling of the story of the mother and her seven sons who were martyred:
The mother of seven sons expressed also these principles to her children:
“I was a pure virgin and did not go outside my father’s house; but I guarded the rib from which woman was made.
No seducer corrupted me on a desert plain, nor did the destroyer, the deceitful serpent, defile the purity of my virginity.”
The phrase “the rib from which woman was made” is a clear reference to the story of the creation of Eve in Genesis 2, and the mention of the seduction and the defilement by the serpent would seem to refer to the story of Eve and the serpent in Genesis 3. By having the mother boast that she was not seduced by the serpent, the author implies strongly that Eve was. For example, a few even went as far as to suggest that Cain was actually the snake’s son rather than Adam’s, which to them apparently explains why Cain was (inclined towards) evil: he was the fruit of an unnatural union.
A late Jewish retelling (
midrash) of biblical stories, the
Pirqe De-Rabbi Eliezer (8th-9th century or earlier), adopts this whole ‘Cain was the son of the serpent’ story.
Sammael was the great prince in heaven: the
Chayyot had four wings and the Seraphim had six wings, and Sammael had twelve wings. What did Sammael do? He took his band and descended and saw all the creatures which the Holy One, blessed be He, had created in His world and he found among them none so skilled to do evil as the serpent, as it is said, “Now the serpent was more subtil than any beast of the field.” Its appearance was something like that of the camel, and he mounted and rode upon it. The Torah began to cry aloud, saying, ‘Why, O Sammael! Now that the world is created, is it the time to rebel against the Omnipresent? Is it like the time when thou shouldst lift thyself up on high? The Lord of the world “will laugh at the horse and its rider” (Job 39:18).’
…] (Samael) riding on the serpent came to [Eve], and she conceived; afterwards, Adam came to her, and she conceived Abel, as it is said, “And Adam knew Eve his wife.” What is the meaning of “knew”? (He knew) that she had conceived. And she saw his [Cain’s] likeness that it was not of the earthly beings, but of the heavenly beings, and she prophesied and said: “I have gotten a man with the Lord.”
In other words, when Eve gave birth to Cain, she found out that he did not look so much human as he did an angel - at which she knew that the child’s father was not Adam, but the angel Samael who came with the serpent. An Aramaic translation-paraphrase (
targum) of Genesis, the Targum Pseudo-Jonathan, also inserts the same idea into the text:
And Adam knew
that his wife Eve
had conceived from Sammael the angel (of death) and she became pregnant and bore Cain. And she said: “I have got a man from
the angel of the Lord.”
And Adam knew Eve his wife
who lusted after the angel; and she conceived and bore Cain, and said, “I have gotten a man,
the angel of the Lord.”
While the above sources are quite late, the tradition behind it or something similar (that Cain’s father was the serpent = the angel Samael) was apparently already known in the 2nd century, since St. Irenaeus mentions gnostic groups who seem to have used this idea (
Against Heresies 1.30.9 “[The Ophites] affirm that the serpent cast down has two names, Michael and Samael”).