Your website needs to neat, clean and organized... and not just the way it looks. The code needs to be that way because that's what the search engines see. Google and other search engines crawl your site to determine where it should rank your site. Then they take those results and calculate them in with a bunch of other factors and ultimately assign your rank for different keywords. Don't get me wrong, they way your website looks and works is very important. But equally important is the code that lies beneath the visual representaion your website visitors see.
We refer to this as the "On-Site Optimization". It usually represents anything that can done on your physical website to enhance your chances of ranking higher. For instance this can be tweaking the words on your pages. It is important to know where to place those words, how often to repeat those words and how densely populated those words should be in relation to other words on your page. Other on-site factors include header tags (h1, h2, h3), page titles, image names, alt tags, meta tags, etc. The general rule of thumb is the better your code is, the more on-site optimized your website is. If your website has clean code and has everything in place to identify what your site is about, then your site is optimized (on-site). Your website, is the foundation for everything else!