As you've noted yourself, the last line of the proof depends on the ring having an $1$ (that it, a multiplicative identity), which is what "ring with unity" means. So even if the theorem were to be true for rings without unity, it can't possibly be so "with the identical proof.
The ring needs to be commutative, because polynomials don't work well over non-commutative rings. For example, the product of two first-degree polynomials would be
$$ (aX+b)(cX+d) = aXcX + bcX + aXd + bd $$
but according to the usual rule for the coefficients of a product of polynomials we ought to get
$$ acX^2+(bc+ad)X + bd $$
and that's only equal to the above expression if $X$ commutes with $c$ and $d$.
We could still simply declare the polynomial multiplication rule to be valid in the noncommutative case and work with purely formal polynomials, investigating where that leads us. But the cost of doing that is that exactly the theorem you're looking at fails to hold. In more primitive terms, what happens is that the product of the values of two polynomial functions wouldn't equal the value of the product polynomial for the same input, or $p(x)q(x)\ne (pq)(x)$ in general.