Genesis 38:9-10: But Onan knew that the offspring would not be his; so when he went in to his brothers wife he spilled the semen on the ground, lest he should give offspring to his brother.
On the other hand I do not believe there is any thing wrong with what Onan did except disobey the commandment that was for the purpose of multiplying.
Modern America has turned THIS on it's head!
We raise up children that are NOT ours by subsidizing others to produce them!