There was a panel session on the future of algebraic topology at the birthday conference for Gunnar Carlsson, Ralph Cohen, and Ib Madsen. At the beginning of the panel, Bill Dwyer raised the point that most of us are never going to do work that will be remembered hundreds of years hence by future mathematicians, and largely will be read by a small circle of our peers. Rather than despairing at this fact, he compared this work to "making a nice dinner for your friends," an intrinsically worthwhile and rewarding task. That is, being a part of this community and doing the work that we do is often its own reward.
Not a perfect answer by any means, but one that I find more honest and compelling as time goes by.