One of the 'jokes' of Zen is that people will spend so much time attempting to reach enlightenment, only to realize there wasn't anything in particular to realize.
Case in point, Mu. http://en.wikipedia.org/wiki/Mu_(negative)
Personal anecdote: I used to be the sort of programmer who would waste all my time surfing the net, and maybe banging out a script once in a blue moon, while congratulating myself on working 'smart'. The end result: a massive backlog of unfinished tasks, and a whole lot of wasted years.
Thing is, working hard and working smart - they aren't mutually exclusive. I found out all too late that when we say 'laziness is a virtue', we actually mean 'efficiency is a virtue'. It's the desire to be efficient at our job that leads to DRY and building productivity-multipliers. Laziness - that just leads to thumb-twiddling.
Work, work, work, work, work, more work, work more, must achieve success, must attain the "goal"
...ark, ack, nyug, gasp, Die.
We all meet the same end whether we attain something (achievement oriented successful person) or not (good for nothing enlightened lazy person).
If I have tasks to do involving programming, I would naturally gravitate towards doing them rather than screwing around.
Hmm. Perhaps you don't have enough passion for programming. I'm not trying to attack your skills or anything, but if I were you, I'd try to find something that involves coding, so you don't have to learn completely new skills, but that you actually have passion for. Then apply your skills towards that.
The thing about passion is that it makes most every other concern moot. You don't have to worry about procrastination, you don't need to concern yourself with whether you're wasting your life, because you already have something driving your actions every day.
Laziness is then defined as "The quality that makes you go to great effort to reduce overall energy expenditure." You don't want to spend an hour writing 40 slightly different functions, so you spend 3 drilling into the problem domain and devise an abstraction that allows you to express the whole thing in 17 lines of code.
His project manager might call him lazy, after all, he technically pushed back project completion by two hours more than needed, by wasting time on an abstraction that was probably unnecessary, all just to scratch an itch. Is it, though? You could argue both ways.
Are those bad? It sounds like you might have learned a hard lesson, and I'd be curious to hear more.