Example 3 If $x, y, z$ are all positive real numbers, and $x^{2}+y^{2}+$ $z^{2}=1$, then the minimum value of $S=\frac{(z+1)^{2}}{2 x y z}$ is $\qquad$.
Given $x^{2}+y^{2}+z^{2}=1$, let
$$
\begin{array}{l}
x=\cos \theta \cdot \cos \varphi, \\
y=\cos \theta \cdot \sin \varphi \\
z=\sin \theta\left(\theta, \varphi \in\left(0, \frac{\pi}{2}\right)\right) .
\end{array}
$$

Then $S=\frac{(z+1)^{2}}{2 x y z}=\frac{(1+\sin \theta)^{2}}{\sin \theta \cdot \cos ^{2} \theta \cdot \sin 2 \varphi}$
$\geqslant \frac{(1+\sin \theta)^{2}}{\sin \theta \cdot \cos ^{2} \theta}\left(\varphi=\frac{\pi}{4}\right.$ when the equality holds $)$
$$
=\frac{(1+\sin \theta)^{2}}{\sin \theta \cdot\left(1-\sin ^{2} \theta\right)}=\frac{1+\sin \theta}{\sin \theta \cdot(1-\sin \theta)} \text {. }
$$

Let $t=1+\sin \theta \in(0,2)$. Then
$$
\begin{aligned}
S & =\frac{t}{-t^{2}+3 t-2} \\
& =\frac{1}{-\left(t+\frac{2}{t}\right)+3} \\
& \geqslant 3+2 \sqrt{2}
\end{aligned}
$$

Thus $t=\sqrt{2}$
$$
\Rightarrow \sin \theta=\sqrt{2}-1
$$