Fucked me in school.
"Write a paper on X". Cool. Read about X, learn about X, sit down to write paper that will be read once and thrown in the trash and that a billion other people have already written... motivation goes out the window. I can already write well (I've written 1,000 of these goddamn things) and I already know the material that's going in the paper. No one truly cares about what I'm about to write—no one needs it, and no one really even wants it. Suddenly a blank wall is more interesting.
Give me a real need to learn something or just let my curiosity take me where it will, and I'm the world's most dangerous carnivore. I'll run a problem down and eat its damn heart, then take out the rest of the herd for funsies. Otherwise? I'm probably boned.
The elimination of the uselessness of the end product that comes with doing actual work rather than "homework" has helped a lot, but it's still something I have to fight, years later. The multi-year process of adjusting my image of the way thought I ought to be to accommodate the fact that I simply was not compatible with a formal educational setting really sucked. Those were some sad years full of serious self-loathing. My self-loathing is far more lighthearted now
I still hate maintaining systems and chasing bugs that don't require much sleuthing. Any time I'm required to make some "quick hacks" to fix something in an ugly way for lack of time is a bad day, and I'll go home in a bad mood and show up the next day in a bad mood. I'm probably the happiest at work either designing systems or fixing things that have broken in strange ways, when I'm fully engaged in a problem for hours on end. Exercising the clever-muscle in my brain is great and makes the hours fly like nothing else, and playing grown-up legos when designing is fun. Practically everything else about being a programmer sucks, but WTF else am I going to do? At least it's fun some of the time, which beats most jobs.
As with any personal trait or behavior I'd guess I'm far from being alone.