A. There are certain industry standards the code of web pages should comply with. You can read more about them here.
A failure to comply with these requirements can have 2 main consequences in terms of SEO:
The site will be less often crawled by search engine robots. As a result, new content will take longer to get indexed.
The site's pages will be losing positions on SERPs (the number depends on how severe the errors are). So a page with a clean code will often show up higher in search results than a similar page with deficiencies.
It's not that the search engines are hostile to imperfections. The reasons are quite pragmatic. Pages with validations issues take more of the robots' time and resources so visits to them are more expensive. What is more, they tend to load slower. Some elements may work or be displayed incorrectly on them. This hinders users' experience with the website. A search engine risks its own reputation referring people to web resources they may not be totally satisfied with.
This is basically why code validation has been included into WebSite Auditor's workflow.