I believe this should be reported as a bug in babel-spanish.
Anyway, since typing \widehat{<} is not really good because it will produce wrong spaces, you can use a workaround: define a command before the special action of babel-spanish enters the scene.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\newcommand{\lesshat}{\mathrel{\widehat{<}}}
\begin{document}
$a<b\lesshat c$
\end{document}

If you want to type \hat{<} or \widehat{<} in the body of the document, you can't unless you load
\usepackage[spanish,es-noquoting]{babel}
but, as I said at the beginning, this would produce wrong spacing because \hat{<} would be considered an ordinary symbol.
Thanks to Dan for pointing out that in a former version of the answer \string was not needed.
\documentclass{article}– kubo Nov 13 '21 at 17:21\documentclass{article}\begin{document}$\hat{<}\widehat{<}$\end{document}not give you what you are looking for? – Dan Nov 13 '21 at 17:23\usepackage[spanish]{babel}. That seems to be the problem. How can I solve it? – kubo Nov 13 '21 at 17:32babelpackage doesn't give me a problem. (Try\documentclass{article}\usepackage[spanish]{babel}\begin{document}$\hat{<}\widehat{<}$\end{document}) What other packages are you using? It could be helpful if you added a minimum working example of your code that generates the issue to your question. – Dan Nov 13 '21 at 17:35Placing
– jasonhathcock Nov 13 '21 at 19:29\newcommand{\lt}{\symbol{"3C}}in the preamble and using either$\widehat{\lt}$or$\hat{\lt}$works for me, even with\usepackage[spanish]{babel}. Of course, this may get cumbersome if you have to do something similar for several other symbols, but it is a start.