Is there a scripture stating, “It is better that a man spill his seed in a whore’s belly than on the ground”?

There simply is no such verse in the Bible! It may stem from a misrepresentation of Genesis 38. The first part of this chapter recounts a situation in ancient Israel, in which the young widow Tamar expected her unmarried brother-in-law Onan to marry her and give her children to “continue the name” of her dead husband. This was a command from God, summarized in Deuteronomy 25:5-10, to ensure the continuation of families in the nation of Israel. As part of the Old Covenant, this national statute is not binding for us today.