Confusion about proof of undecidability of REGULAR TM in Sipser's book
A universal Turing machine accepts a machine $M$ and an input $x$, and simulates the run of $M$ on $x$.


If $M$ halts on $x$, the universal Turing machine will also halt, and will output the state of $M$ at the end of computation.
If $M$ doesn't halt on $x$, the universal Turing machine will also not halt.


This is what the machine $M_2$ does on step 2. It simulates $M$ on $w$, and may or may not halt. What a universal Turing machine cannot accomplish is solve the halting problem, that is, given $M$ and $x$, do some computation which always terminates, and answer whether $M$ halts on $x$ or not. Instead, it simulates $M$ on $x$, and halts iff $M$ halts on $x$.

We shouldn't be able to tell whether an arbitrary machine $M$ halts on an arbitrary $w$ or not. The reduction translates this question into the question whether $L(M_2)$ is regular. Since the former question is undecidable, so is the latter one.