See MWE below. The symbol ! in the \index causes an error. This is only the case in align environments (not in equation). So it seems to have to do something with amsmath. If ! is put in an \mbox there is no error. But then of course the font size is not adjusted to subindices. Curiously enough, \index{$C_{K!!}$} (two exclamation marks) doesn't cause any error.
\documentclass{article}
\usepackage{amsmath}
\usepackage{imakeidx}
\makeindex
\begin{document}
\begin{align}
y\index{$C_{K!}$}
\end{align}
\printindex
\end{document}
Any solutions suggested?