[guided]We need $\mathfrak r$ to be an ideal because semisimplicity rules out nonzero solvable ideals. Since $\mathfrak r$ is an intersection, it is enough to show that $\mathfrak a^\perp$ is an ideal.
Let $z \in \mathfrak a^\perp$, let $y \in \mathfrak g$, and let $t \in \mathfrak a$. To prove $[y,z] \in \mathfrak a^\perp$, we must prove that $\kappa_{\mathfrak g}([y,z],t)=0$ for every $t \in \mathfrak a$. The invariance of the Killing form says that bracket operations may be moved from one argument to the other with the corresponding sign convention. Using invariance and symmetry, we get
\begin{align*}
\kappa_{\mathfrak g}([y,z],t)
&= -\kappa_{\mathfrak g}(z,[y,t]).
\end{align*}
Now $\mathfrak a$ is an ideal, so $[y,t] \in \mathfrak a$. Since $z \in \mathfrak a^\perp$, it is orthogonal to every element of $\mathfrak a$. Therefore
\begin{align*}
\kappa_{\mathfrak g}([y,z],t)
&= -\kappa_{\mathfrak g}(z,[y,t])
=0.
\end{align*}
This holds for all $t \in \mathfrak a$, so $[y,z] \in \mathfrak a^\perp$. Hence $\mathfrak a^\perp \trianglelefteq \mathfrak g$. Since intersections of ideals are ideals, $\mathfrak r=\mathfrak a \cap \mathfrak a^\perp$ is an ideal of $\mathfrak g$.[/guided]