To index a nontrivial TeX expression expr,
we use the command \index{str@expr}, where str is a simplified (typically plain ASCII) representation of expr to be used for sorting.
However, str@expr is parsed incorrectly inside a footnote:
\documentclass{report}
\usepackage{imakeidx}
\makeindex
\def\gnu{\texttt{Gnu}}
\def\gnat{\texttt{Gnat}}
\begin{document}
Some text\index{Gnu@\gnu}\index{Gnat@\gnat}.
\pagebreak
Some more text\index{Gnu@\gnu}.\footnote
{A footnote.\index{Gnat@\gnat}}
\printindex
\end{document}
This generates the following .idx file
\indexentry{Gnu@\gnu}{1}
\indexentry{Gnat@\gnat}{1}
\indexentry{Gnu@\gnu}{2}
\indexentry{Gnat@\texttt {Gnat}}{2}
The two index entries for 'Gnat' differ, and therefore \Gnat appears
twice in the index, as shown in this screenshot:

How does \footnote modify the \index command, and what can be done about it?

\indexis in the argument to another command, the special treatment to the argument cannot be performed. It's been in LaTeX from day one. I linked a duplicate (it's about\caption, but the phenomenon is the same). For the special case of footnotes, loading thebigfootpackage solves the issue. – egreg May 04 '15 at 12:04\indexinside an argument' in both cases, and that problem is the same. – Joseph Wright May 04 '15 at 12:47