I started teaching HTML in the ’90s. At that time, I would tell students that valid code was important for several reasons, but the one that seems to stick was that it might help them troubleshoot why pages (p-p-p-pages) looked so different between browsers at the time.
You see, at that stage, there were many different browsers, but Netscape was the current champion with Internet Explorer the up and coming underdog. While there were standards for coding your Web pages, neither browser really followed them, which is why some pages could look wildly different between IE and Netscape.
At that time, the student might not know if the problem was with their code or with the browser. By validating the code, they could start to eliminate potential problems.
Fast-forward to 2006. IE is the current champion, and FireFox (a relative of Netscape) is an up and coming underdog. While the new roles certainly signifies ch-ch-changes, the need for valid code remains the same.
XHTML (the evolution of HTML) is all about logically defining how content relates and not about how it looks. CSS is supposed to take care of that.
CSS1, the first level of the standard, took care of the basic visual chores of the horrid font tag and a few other simple visual feats. CSS2 (and 3) took on a much larger role. There are logic flow capabilities now, so that you can specify “if a heading level 3 is a direct child of a heading level 2, make it green, otherwise, make it red”. This is a powerful, but very hard to troubleshoot if your code is not logically marked up.