I write a lot of code as a substitute for doing 'repetitive' work and dealing with complex processes I can hand off as a 'product' to customers, collaborators and volunteer efforts.
Some of this is professional development driven and some of it's driven by necessity so I don't have time consuming things I have to do periodically (if I can code it to avoid such a thing). As I often say: "Time is not a luxury I have much of" (aka: I'm all about saving time in the long run and will make an 'up front investement' to code it so I won't have to revisit 'manual labor' that's more suited to automation).