John Mueller of Google said on Twitter that HTML validation "pretty much doesn't matter" for ranking in Google. This not new news, in fact, we covered this two years ago and also back in 2009.
Here is John's tweet:
@robinlmay As long as it can be rendered & SD extracted: validation pretty much doesn't matter.
— John ☆.o(≧▽≦)o.☆ (@JohnMu) May 1, 2017
Now, when it comes to structured data, href lang and other forms of markup - that markup should validate for Google to properly pick up on the markup. But for normal web ranking, validation is not necessary to rank well in Google.
Most of the web doesn't validate anyway and Google still needs to discover and rank most of the web's content.
Forum discussion at Twitter.