Firstly, to show off!
Secondly, because it is very rewarding. To create something non-trivial and watch it work for the first time, after a dozens of failures, gives me a lot of satisfaction.
Wow, the question actually made me more aware of my motivation. It seems that everything I did was some case of "it looks simple, I can do it! Others will admire me. :)".
I, as a kid, played a lot of games on Amiga 500.
Naturally, I was amazed by them and didn't even dream of doing a game myself.
Later in life, a friend showed me how to do a 3d model in 3d Studio.
I liked it a lot, I could spend nights polishing minor details on car models (like those: http://hrekin.za.pl/)
As I was spending a lot of time in front of a computer, parents decided it would be nice thing for me to study Computer Science.
I remember, that my expectation then was something along the lines "They will teach me there how to make an application like 3d Studio Max", or actually any other desktop application. I was truly believing it would be the case. I was trying really hard to learn as much to make it happen.
But still, even 3 years after graduation, I didn't know how to write a desktop application which does some very rudimentary things. I was expecting it would be very easy to it, since everybody else seemed to do it: you click on a file with a certain extension and appropriate app opens.
Today, I am actually writing a very simple desktop application with all the pieces in place.
Of course, in the course, I had successes in more job related fields. I did survive a financial app maintenance and even got to sell one Android application to a commercial bank - which wasn't trivial, since it had some advanced computer vision stuff implemented (in pure C, no libraries used). I also wrote a C# game.