The two proofs so far are either for commutative rings with unity, or for the notion of "completely prime" as opposed to prime. Here's a proof that holds in more generality.
Recall that in a not-necessarily-commutative ring $R$, the definition of prime ideal is that $I$ is a prime ideal if and only if $I\neq R$, and for any ideals $\mathfrak{A}$ and $\mathfrak{B}$, $\mathfrak{AB}\subseteq I$ implies $\mathfrak{A}\subseteq I$ or $\mathfrak{B}\subseteq I$. This is a weaker condition that "completely prime" (the element-wise version); for example, in the ring of $n\times n$, $n\gt 1$, matrices over a field $F$, the trivial ideal $(0)$ is prime, but not completely prime (since we can have $a,b\in R$ with $ab=0$ but $a\neq 0\neq b$). But every completely prime ideal is necessarily prime. In commutative rings with unity, the two notions coincide.
The proof is very similar to Alex Becker's computation.
Theorem. Let $R$ be a ring, not necessarily commutative, not necessarily with unity, such that $R^2$ is not contained in any maximal ideal of $R$ (in particular, this holds if $R$ has a unity). If $\mathfrak{M}$ is a maximal ideal of $R$, then $\mathfrak{M}$ is a prime ideal of $R$. Conversely, if $R^2$ is contained in a maximal ideal $\mathfrak{N}$, then $\mathfrak{N}$ is not prime.
Proof. Assume $R^2$ is not contained in any maximal ideal, and let $\mathfrak{M}$ be maximal in $R$. Let $\mathfrak{A},\mathfrak{B}$ be two ideals of $R$ that are not contained in $\mathfrak{M}$; we prove that $\mathfrak{AB}\not\subseteq \mathfrak{M}$.
Since $\mathfrak{M}$ is maximal, and $\mathfrak{A},\mathfrak{B}\not\subseteq \mathfrak{M}$, then $\mathfrak{A}+\mathfrak{M}=\mathfrak{B}+\mathfrak{M}=R$. If $\mathfrak{AB}\subseteq \mathfrak{M}$, then we have: $$\begin{align*} R^2 &= (\mathfrak{A}+\mathfrak{M})(\mathfrak{B}+\mathfrak{M}) \\ &=\mathfrak{AB}+\mathfrak{AM} + \mathfrak{MB}+\mathfrak{M}^2\\ &\subseteq \mathfrak{AB}+\mathfrak{M}\\ &\subseteq \mathfrak{M}+\mathfrak{M}\\ &=\mathfrak{M}. \end{align*}$$ But this contradicts our assumption that $R^2$ is not contained in any maximal ideal; therefore, $\mathfrak{AB}\not\subseteq \mathfrak{M}$, as desired.
If $\mathfrak{N}$ is a maximal ideal that contains $R^2$, then $\mathfrak{A}=\mathfrak{B}=R$ are a witness to the non-primality of $\mathfrak{N}$. $\Box$
If we assume $R^2=R$ (instead of simply that $R^2$ is not contained in any maximal ideal of $R$), then the proof can be done directly, instead of as by contradiction, by showing that $\mathfrak{AB}+\mathfrak{M}=R$.
For an example where $R^2\neq R$ but we still have that the implication holds (vacuously), take $R=\mathbb{Q}$ with zero multiplication. Then ideals corresponds to subgroups, and since $\mathbb{Q}$ has no maximal subgroups, it is still true that every maximal ideal is also a prime ideal.