[guided]The purpose of this step is to convert an energy bound into a compactness statement. The energy only controls the gradients directly, so we must also recover control of the $L^p$ norms of the functions themselves. The affine boundary condition is exactly what permits this.
For each $k\in\mathbb N$, the lower growth assumption says that, for $\mathcal L^n$-a.e. $x\in U$,
\begin{align*}
f(x,u_k(x),\nabla u_k(x))\ge \alpha|\nabla u_k(x)|^p-a(x).
\end{align*}
Integrating over $U$ with respect to $\mathcal L^n$ gives
\begin{align*}
I[u_k]\ge \alpha\int_U |\nabla u_k(x)|^p\,d\mathcal L^n(x)-\int_U a(x)\,d\mathcal L^n(x).
\end{align*}
The integral of $a$ is finite because $a\in L^1(U)$. Since $I[u_k]\le M$, we obtain
\begin{align*}
\int_U |\nabla u_k(x)|^p\,d\mathcal L^n(x)\le \frac{M+\int_U a(x)\,d\mathcal L^n(x)}{\alpha}.
\end{align*}
Thus the gradients $\nabla u_k$ are uniformly bounded in $L^p(U;\mathbb R^n)$.
This is not yet a $W^{1,p}$ bound, because the Sobolev norm also contains the $L^p$ norm of $u_k$. We now use the Dirichlet structure. For each $k\in\mathbb N$, define the map $w_k:U\to\mathbb R$ by $w_k(x)=u_k(x)-g(x)$ for $x\in U$. Since $u_k\in g+W^{1,p}_0(U)$, we have $w_k\in W^{1,p}_0(U)$. Poincare's inequality on $W^{1,p}_0(U)$ applies because $U$ is bounded and Lipschitz; it gives a constant $C_P=C_P(U,p)>0$ such that
\begin{align*}
\|w_k\|_{L^p(U)}\le C_P\|\nabla w_k\|_{L^p(U)}.
\end{align*}
Since $w_k=u_k-g$, its weak gradient is
\begin{align*}
\nabla w_k=\nabla u_k-\nabla g
\end{align*}
in $L^p(U;\mathbb R^n)$. The triangle inequality in $L^p(U;\mathbb R^n)$ gives
\begin{align*}
\|\nabla w_k\|_{L^p(U)}\le \|\nabla u_k\|_{L^p(U)}+\|\nabla g\|_{L^p(U)}.
\end{align*}
The first term on the right is uniformly bounded by the energy estimate, and the second is fixed because $g\in W^{1,p}(U)$. Therefore $(w_k)$ is bounded in $W^{1,p}(U)$. Finally $u_k=g+w_k$, so adding the fixed function $g$ preserves boundedness. Hence $(u_k)$ is bounded in $W^{1,p}(U)$.[/guided]