George Orwell once said that he – and all writers – wrote for a combination of four reasons:
1. Sheer egotism – The desire to seem clever
2. Aesthetic enthusiasm – The perception of beauty in the external world or in words and their right arrangement
3. Historical impulse – The desire to see things as they truly are
4. Political purpose – The desire to push the world in a particular direction
There are probably parallels in software development (for the first two items, definitely). If you write software, why do you do it? Post here.