In the reduction from HALT to ALLHALT, why does the constructed Turing machine loop indefinitely when the inputted Turing machine rejects?
Because the problem HALT defined in the online source is different from yours. Their HALT is defined as:

\begin{align}
\{ \langle M, w\rangle \mid{} &amp;M\text{ is a Turing machine, $w$ is a string,}\\
&amp;\text{and $M$ }accepts\text{ $w$ after a finite computation}\}
\end{align}