1) Build that next big thing everyone uses, which improves peoples lives (which probably only is in the list because I spend too much time on HN)
2) Help people in a very direct manner. A great example for this is Johnny Long, who stopped hacking for money and went to Uganda, using his energy and skills to help those who need it most.
3) Have and raise children. To me this seems to be the most commonly chosen path, mostly because it's only natural. But if you think about it, having children and raising them to be goodhearted, responsible persons with a high moral self-demand [1] is a honorable way of improving the future of our world. Thinking about it this way, though, will probably make the decision of having children myself one day really hard, the responsibility seems remarkable.
That said, it probably comes down to what it always comes down to in life: strike an appropriate balance between all factors of life.
[1] It's really hard to say what makes a good person. I hope you get the idea :)