Bereshis 38:9

9 And Onan knew that the zera should not be his; and it came to pass, when he went in unto eshet achiv, that he spilled it on the ground, lest he should give zera to achiv.

Bereshis 38:9 Meaning and Commentary

Genesis 38:9

And Onan knew that the seed should not be his
Should not be called a son of his, but a son of his brother Er; this is to be understood only of the firstborn; all the rest of the children born afterwards were reckoned the children of the real parent of them; this shows this was a custom in use in those times, and well known, and was not a peculiar case: and it came to pass, when he went in unto his brother's wife;
to cohabit with her, as man and wife, he having married her according to his father's direction: that he spilled [it] on the ground, lest he should give his seed to
his brother:
lest his brother's wife he had married should conceive by him, and bear a son that should be called his brother's, and inherit his estate; and this is the sin, which from him is called Onania, a sin condemned by the light of nature, as well as by the word of God, and very prejudicial to mankind, as well as displeasing to God, as follows:

Bereshis 38:9 In-Context

7 And Er, bechor Yehudah, was rah in the eyes of Hashem; and Hashem slaughtered him.
8 And Yehudah said unto Onan, Go in unto eshet achicha, and enter into levirate marriage with her, and raise up zera to achicha.
9 And Onan knew that the zera should not be his; and it came to pass, when he went in unto eshet achiv, that he spilled it on the ground, lest he should give zera to achiv.
10 And the thing which he did was rah in the eyes of Hashem; therefore He slaughtered him also.
11 Then said Yehudah to Tamar his kallah, Remain an almanah at thy bais avi, till Shelah beni is grown; for he said, Lest he die also, as his achim did. And Tamar went and dwelt in her bais avi.
The Orthodox Jewish Bible fourth edition, OJB. Copyright 2002,2003,2008,2010, 2011 by Artists for Israel International. All rights reserved.