I suspect that MathML is ugly to start with, and that is the source of the problem
The \phantom{\rule{...}{...}} is a pretty strange construction. It seems that its purpose is to introduce a space, which would be better handled as \kern .25em or \hskip .25em or \hspace{.25em} (depending on your preferences). The original MathML may have been <mphantom><mpadded width=".25em" height="1ex" mathbackground="black" /></mphantom> or something similarly ugly.
In any case, this is the source of the problem. Because the combined configuration files (that handle TeX input) all include the noUndefined extension, unknown macros are displayed as their macro name in red. So since \rule is not defined in MathJax, when \rule{.25em}{1ex} is processed, it produces output equivalent to "\rule.25em1ex" with "\rule" in red. Then this is wrapped in \phantom, so it is not displayed, but takes up the same space, and in particular, is as white as these characters. That is why you are getting large blank spaces. So this is "correct" behavior for the given situation.
You could include a definition for \rule that would resolve the problem. For example, the equivalent of
\def\rule#1#2{\Rule{#1}{#2}{0pt}}
provided that your uses of \rule never include the optional offset (e.g., \rule[3pt]{.25em}{1ex}). To handle the offset would take some extra work.
Davide