Gene expression
Your thumb and ear contain the same DNA.
Your ear's cells have the DNA and neighboring cells configured to only make your ear, because only the genes to make an ear are able to be turned on and used for expression.
Same for your thumb.
The sperm situation is almost the exact same thing, but there's some minor differences. Thus your sperm cells having half a chromosome set.
Either way, the principle is similar. Your ear and thumb have the necessary DNA to code your sperm, it's just not turned on and the gene's don't express out of place. If they did express out of place, firstly, that's nasty, secondly, that's cancer.
But I think it's much more rare in the case of sperm, the gene expression is fairly different, because it uses half a chromosome set.
Someone else more well versed in modern genetics. I don't remember if sperm contains the full chromosome set on itself somewhere, and JUST injects the half set at egg encounter...
Or if the entire sperm is a half set.
Genetics people? Help me out, it's been a decade since my genetics courses.