Racehorses are not always geldings otherwise no racehorses could be studs.
Their genetics are collected before gelding, and frozen in liquid nitrogen.
Or their genetics are duplicated in another foal, and he will stand Stud.
An intact racehorse is very unpredictable, although there have been a few over the years.
Sadly, when a winner dies it's the end of his line, so they go back to the parental stock, as most horses can breed for decades, and the genetics are passed on without the true " winner " having anything to do with it....he has been gelded ( in most cases) far before his potential was realized.
Which is why a Thorough Bred mare, is worth far more than a Thorough Bred gelding, as she can reproduce, and pass on her genes.
I think it's more common in the US to race intact horses....but my knowledge lies in the foundation stock of working Quarter Horses.