Yes.
One direction is immediate by the Sphere theorem (projective plane theorem) as pointed out by the OP.
Assume $M$ satisfies $\pi_2(M)=0$. Note that this condition with the Poincare conjecture means any sphere in $M$ bounds a $3$-ball (see here). Therefore, we conclude that $M$ is irreducible.
Suppose $M$ contains a $2$-sided $P^2$. One considers the orientation double cover $M'\overset{p}{\longrightarrow} M$ and assume $p^{-1}(P^2)=S$ which is a sphere (not $P^2$s by our assumption). As above, $S$ bounds a $3$-ball $B$ and we consider $B\overset{p}{\longrightarrow} p(B)$. It is not hard to show this is a double covering map. However, the involution on $B$ contains a fixed point by Brouwer fixed-point theorem. We obtain a contradiction.