I would figure a lot of what you pay a doctor for is not to mend every problem you have with your body to but to ensure that it's done timely, safely, and with the least amount of risk/damage/scarring/whatever as possible. Yeah you could probably do your own surgery but why?
Learning to code is hardly as serious an undertaking and yet it teaches you how to think about solving a problem, estimating time to solve that problem, and reducing the amount of time needed to create the solution to that problem. It teaches general problem-solving skills and at the very least can lead to recreational uses (building small games or family web sites).
I think problem-solving is probably one of the most important skills one needs in his toolbox to succeed in life and so why wouldn't it be taught as early as children can comprehend it?