You need to enable sgml-xml-mode:
If non-nil, the tag insertion functions will be XML compatible.
sgml-modetrying to guess if your buffer is in XHTML (and therefore automatically turn it on sgml-xml-mode) by looking at doctype. See Function sgml-xml-guess. He expects to find a string "XHTML"somewhere in the DTD name.
sgml-xml-guess , sgml-xml-mode . , :
(add-hook 'html-mode-hook #'(lambda nil (setq sgml-xml-mode t)))