I can cite numerous examples of sites that are at the very top of the SERPs with terrible coding. That being said, valid code has more to do with compatibility issues. In other words, what good is it if you are at the top of the SERPs, but your site doesn't display properly. Search robots don't need to see your layout, people do.
So, design the site with people in mind. Validate the code. It is a separate issue from
SEO, however, validating may show you areas where your site will not only improve with regards to compatibility, but also to have more to index. The "alt" attribute for images comes to mind.