Nikola Tesla and Isaac Newton were virgins as well. It might be argued that a certain level of unresolved frustration can be a driving force in technical pursuits...
I would argue it's probably a bit of both. Fulfilling sexual relationships are one way to feel a sense of satisfaction in life, and having kids is one way to achieve a kind of legacy. Solving hard technical problems and moving science forward is another way to achieve the same goals. One could pursue both, but if you already have one you might be less likely to feel a strong visceral need for the other.