A. Hardware/OS/experience. At first, I was excited by the experience of working with computers. When I got access to a special computer lab in college that had Suns with big monitors, I used to go there and program just to use the computers. I loved the excitement of learning new commands, playing with different desktop managers, mastering various editors. All of it was in service of programming, but it was fun on its own.
B. As that stage faded, I was excited by specific technologies (Java! XML! Whatever!). During this phase, I would write something in one language, or using one technology, and then get excited about re-writing it in a different language or using a different technology.
C. The final, and most lasting, phase for me was getting excited about the problems I work on. Now, the hardware and the technologies have become tools for me, but the problems are infinitely interesting. What excites me most is working on problems that I believe matter.
Of course, I sometimes go back to stage B (MongoDB! AWS!) or maybe even stage A (general purpose GPU programming!), but mostly its stage C that keeps me passionate.