PCA formulation - Deep Learning book by Ian Goodfellow
He means that $D$ must work well on all data points, not just a single one. I.e., $$ z_i = Dx_i \;\;\text{ so that }\;\; || (I - D^TD)x_i ||_2^2 \;\;\text{ is small } $$ for all $i$. If we could choose a different matrix, say $M_i$ for each $x_i$, then we could minimize the error $E_i = || x_i - M_i^TM_i x_i ||_2^2$ separately for each $x_i$ in isolation. But since we want a single matrix that works for all points, so we stack them all together and instead optimize
$$ D^* = \arg\min_D \mathcal{E}= \arg\min_D|| X - D^TDX||_F^2 $$
i.e., minimizing across the whole dataset simultaneously.

See e.g. here or here for more.