Programmers solve puzzles.
We handle things which are too complex for most people to keep straight -- not necessarily too complicated for them to understand, but, complicated enough that they don't want to mess with them. They discover problems to which we can sometimes provide solutions.
Some solutions help people (medical, educational), some hurt people (spam, phishing), some are gray area doing good, bad, and not much all at once (Grand Theft Auto?), some are academic exercises (code for code's sake that may advance theory and might end up in any other solution later).
The thing that makes me proud is that, if I do it right, I'm solving a problem that may never need to be solved again, building a path between a question and an answer that didn't exist (or wasn't available) before. A clean, reusable solution that other programmers can then take for granted as a stepping stone toward their goals. (In practice things must often be redone, but, ideally, not too often and maybe the essence of my solution can survive and all that needs to be done is to, say, translate the language.)
A daunting puzzle is replaced with an elegant solution.
Hopefully I choose to provide solutions that help educate kids, save lives, etc. instead of those that help rob old people, exploit the poor, et al. If so, I get the sense that I've done something good myself, and that it might make the next good thing that much easier for the next guy. Even coding for a good cause (say, routing ambulances), if done badly, can do much more harm than good. The idea is to be good at the craft and do it for good reasons. When you feel like your work isn't helping anyone (or that it is helping only really evil types) or you feel like you're doing the same thing over and over again (why should you need to re-solve what's now solved?) then it's time for a change.
Programming pays bills, for which I'm very grateful. It helped me buy a house, and provide for my family. If it didn't pay bills, I wouldn't program, but I think I would still solve puzzles (I'd be a mechanical, electrical, or structural engineer, a teacher, an astronomer, a physicist, ... whatever could let me use my mind and still pay enough to keep my family fed, clothed, and sheltered).
Each solution we share has the potential to advance us all.