Imagine you build sand castles all day, every day. You don't do it (only) for money, but because you like it so much. Now imagine some parts constantly collapsing. You want to create perfect castles, so you fix it. And then another part caves in. Then a crab tramples over the whole thing. You are building it for days, but you don't get to finish it because of all these glitches.
Debugging software is similar. Some minor bugs are really annoying. Just like customer requests. We must fix/implement those in order to get our money, instead of doing the fun work of planning and implementing new, interesting features.
Some bugs are really challenging, though. They can hide from you for weeks before finally fixing them, and until then, they are awfully irritating. But then comes euphoria.
Programming in itself is not fun. Solving challenging problems is.