G.H. Hardy was a brilliant mathematician, and also had great insight. He wrote in his book, A Mathematician's Apology, the following:
I shall assume that I am writing for readers who are full, or have in the past been full, of a proper spirit of ambition. A man’s first duty, a young man’s at any rate, is to be ambitious. Ambition is a noble passion which may legitimately take many forms; there was something noble in the ambition of Attila or Napoleon: but the noblest ambition is that of leaving behind one something of permanent value—
Here, on the level sand,
Between the sea and land,
What shall I build or write Against the fall of night?
Tell me of runes to grave That hold the bursting wave,
Or bastions to design For longer date than mine.
Ambition has been the driving force behind nearly all the best work of the world. In particular, practically all substantial contributions to human happiness have been made by ambitious men. To take two famous examples, were not Lister and Pasteur ambitious ? Or, on a humbler level, King Gillette and William Willett; and who in recent times have contributed more to human comfort than they?
Physiology provides particularly good examples, just because it is so obviously a ‘beneficial’ study. We must guard against a fallacy common among apologists of science, the fallacy of supposing that the men whose work most benefits humanity are thinking much of that while they do it, that physiologists, for example, have particularly noble souls. A physiologist may indeed be glad to remember that his work will benefit mankind, but the motives which provide the force and the inspiration for it are indistinguishable from those of a classical scholar or a mathematician.
There are many highly respectable motives which may lead men to prosecute research, but three which are much more important than the rest. The first (without which the rest must come to nothing) is intellectual curiosity, desire to know the truth. Then, professional pride, anxiety to be satisfied with one’s performance, the shame that overcomes any self-respecting craftsman when his work is unworthy of his talent. Finally, ambition, desire for reputation, and the position, even the power or the money, which it brings. It may be fine to feel, when you have done your work, that you have added to the happiness or alleviated the sufferings of others, but that will not be why you did it. So if a mathematician, or a chemist, or even a physiologist, were to tell me that the driving force in his work had been the desire to benefit humanity, then I should not believe him (nor should I think the better of him if I did). His dominant motives have been those which I have stated, and in which, surely, there is nothing of which any decent man need be ashamed.
This may sound a bit outdated in today's world, but is has a certain ring of truth. We should not neglect the past assuming that it is irrelevant.