The account in Genesis 38:9 is a reflection of a ceremonial law in respect to the seed singular. This is referring to the spiritual seed of Christ that is shown in in Galatians 3, and is represented by the “generation of Christ”, as to the genealogy in Mathew beginning with Abraham , who is used as a type to represent our father in heaven not seen, as the father of many nations according to the spiritual seed of Christ.
A distinction between the spiritual seed of Christ and seeds of men after the flesh must be made. Seeds as to the generation of Adam flesh is represented by the genealogy in Luke 3 it goes back to Adam.(natural man)
Galatians 3:16 Now to Abraham and his seed were the promises made. He saith not, And to seeds, as of many; but as of one, And to thy seed, which is Christ.
Good used that ceremonial law to protect His seed, as His word, This was required up until the first century reformation. This is when that shadow gave way to the substance Christ. It is no longer required.
We can see God working out the doctrine of the seed of Christ in Genesis 20
And Abraham said of Sarah his wife, She is my sister: and Abimelech king of Gerar sent, and took Sarah. But God came to Abimelech in a dream by night, and said to him, Behold, thou art but a dead man, for the woman which thou hast taken; for she is a man's wife. Gen 20:1-2
And God said unto him in a dream, Yea, I know that thou didst this in the integrity of thy heart; for I also withheld thee from sinning against me: therefore suffered I thee not to touch her. Gen 20:6
Interesting that God would not even a hint of connecting Abimelech king as part of the genealogy of Christ that he not only prevented him from sinning but that he also closed all the wombs of the house of Abimelech, because of Sarah Abraham's wife. This was until he moved Abraham to pray for the healing.
So Abraham prayed unto God: and God healed Abimelech, and his wife, and his maidservants; and they bare children.For the LORD had fast closed up all the wombs of the house of Abimelech, because of Sarah Abraham's wife. Gen 20:17