The HTML spec is bigger than the web, and consumed by other specifications produced by standards bodies like W3. So for example, ePub expects well-formed XHTML, which includes closing tags.[1] The HTML spec to this day still has XML-compatibility sections.[2][3]
Of course, feel free to do what you want on the web.
For ebooks, we don't rely on the browser to know what to do with sloppy code, because the reader may be not a browser. It may be a Kindle or worse. So being able to strictly validate is a benefit. Also, being able to use xml-based tools for editing and creating is a bonus.
Of course, feel free to do what you want on the web.
[1] https://www.w3.org/TR/epub-33/#sec-xhtml
[2] https://html.spec.whatwg.org/#xml
[3] https://html.spec.whatwg.org/#the-xhtml-syntax