$\newcommand{\norm}[1]{\|{#1}\|}\newcommand{\ip}[1]{\langle{#1}\rangle}$The key is to understanding Equation 6.23 is the following observation:
Let $S$ be a subspace of a finite-dimensional vector space $V$, and let $\{\xi_1,\dotsc,\xi_k\}$ be an orthonormal basis for $S$. Then for any $v \in V$,
$$P_S v = \ip{v,\xi_1}\xi_1 + \cdots + \ip{v,\xi_k}\xi_k$$
is the orthogonal projection of $v$ onto $S$, whilst
$$P_{S^\perp} v = v - P_S v = v - \ip{v,\xi_1}\xi_1 - \cdots - \ip{v,\xi_k}\xi_k$$
is the orthogonal projection of $v$ onto $S^\perp$.
Now, suppose, by induction, that you've constructed an orthonormal basis $\{e_1,\dotsc,e_{j-1}\}$ for $S_{j-1} := \operatorname{Span}\{v_1,\dotsc,v_{j-1}\}$. Then, in particular,
$$
v_j = P_{S_{j-1}} v + P_{S_{j-1}^\perp}
$$
for
$$
P_{S_{j-1}} v_j = \ip{v_j,e_1}e_1 + \cdots + \ip{v_j,e_{j-1}}e_{j-1} \in S_{j-1} = \operatorname{Span}\{v_1,\dotsc,v_{j-1}\}\\
P_{S_{j-1}^\perp} v_j = v_j - \ip{v_j,e_1}e_1 - \cdots - \ip{v_j,e_{j-1}}e_{j-1} \in S_{j-1}^\perp = \operatorname{Span}\{v_1,\dotsc,v_{j-1}\}^\perp,
$$
so that $\{e_1,\dotsc,e_{j-1},P_{S_{j-1}^\perp} v_j\}$ defines an orthogonal basis for
$$
S_j := \operatorname{Span}\{v_1,\dotsc,v_j\} = \operatorname{Span}\{e_1,\dotsc,e_{j-1},v_j\} = \operatorname{Span}\{e_1,\dotsc,e_{j-1},P_{S_{j-1}^\perp} v_j\};
$$
to get an orthonormal basis for $S_j$, you simply normalise $P_{S_{j-1}^\perp} v_j$ to get
$$
e_j := \frac{1}{\norm{P_{S_{j-1}^\perp} v_j}} P_{S_{j-1}^\perp} v_j = \frac{v_j - \ip{v_j,e_1}e_1 - \cdots - \ip{v_j,e_{j-1}}e_{j-1}}{\norm{v_j - \ip{v_j,e_1}e_1 - \cdots - \ip{v_j,e_{j-1}}e_{j-1}}},
$$
which is precisely Equation 6.23. If you're worried about linear independence of $\{e_1,\dotsc,e_j\}$, the point is that it is, by construction, a spanning set with $j$ elements for the $j$-dimensional subspace $S_j$, which is guaranteed to be $j$-dimensional precisely because $\{v_1,\dotsc,v_m\}$ was assumed to be linearly independent.