I think you mean "perpendicular to", not "parallel to", in the question.
It is clear from the formula for $p(x)$ in terms of $x$, $a$, and the inner product, namely $ p(x) = \frac{\langle x, a\rangle}{\langle a, a\rangle} a, $ that $x - p(x)$ is perpendicular to $a$. Just do a short calculation with the formula: $ \begin{align} \langle x - p(x), a\rangle & = \langle x, a\rangle - \langle p(x), a\rangle \\ & = \langle x ,a\rangle - \left\langle \frac{\langle x, a\rangle}{\langle a, a\rangle} a, a \right\rangle \\ & = \langle x,a\rangle - \frac{\langle x, a\rangle}{\langle a, a\rangle} \langle a, a\rangle \\ & = \langle x, a\rangle - \langle x, a\rangle \\ & = 0. \end{align} $ So perhaps your question is really why $p(x)$ is given by that formula. To answer that we'd need to know whatever definition you had of $p(x)$. In any case, for what you want, it's enough to just take the above formula as the definition of $p(x)$. To give the argument:
Fix any $y$ in $\{a\}^{\perp}$. The above calculation shows that $x - p(x)$ is perpendicular to $a$, and so is $y$, so the difference $x - p(x) - y$ is also perpendicular to $a$, and hence to $p(x)$ (as $p(x)$ is a scalar multiple of $a$ by definition). So by the Pythagorean theorem $ \begin{align} d(x,y)^2 & = \|x - y\|^2 \\ & = \|x - p(x) - y + p(x)\|^2\\ & = \|x - p(x) - y\|^2 + \|p(x)\|^2 \\ & \geq \|p(x)\|^2 \end{align} $ and taking square roots one deduces $ d(x,y) \geq \|p(x)\| = \left\|\frac{\langle x,a\rangle}{\|a\|^2} a\right \| = \frac{|\langle x,a\rangle|}{\|a\|^2} \|a\| = \frac{|\langle x,a\rangle|}{\|a\|}. $ The argument given for this inequality also shows that equality holds if and only if $\|x - p(x) - y\|^2 = 0$, ie, if and only if $y = x - p(x)$ (which we know is possible, as we proved $x - p(x)$ was indeed in $\{a\}^{\perp}$ ). This establishes $ d(x,\{a\}^{\perp}) = \frac{|\langle x,a\rangle|}{\|a\|}. $