Consider a sequence $\{u_n\}\subset B$. Since it does exist a constant $C$ ($=1$) such that $||u_n'||_{L^2}\le C\ \forall n\ $ and such that $|u_n(0)|\le C$ $\Big(u_n(0)=u_n(1)=0 \text{ by the definition of the set} \Big)$, then by weak compactness theorem in $W^{1,p}$ spaces, there exists $\bar{u}\in W_0^{1,2}$ and a subsequence $\{u_{n_k}\}$ such that $u_{n_k}\to\bar{u}$ uniformly, and $u_{n_k}'\rightharpoonup \bar{u}'$ weakly in $L^2$ as $k$ goes to infinity. So $B$ is weakly compact.
How to discuss the strong convergence of $B$? The Rellich theorem says that every bounded sequence in $W^{1,p}(\Omega)$, with $\Omega$ bounded and regular $n$-dimensional domain, has a subsequence converging strongly in $L^s(\Omega)$, with $s<\frac{np}{n-p}$. But it is not possibile to use this result since in this exercise $n=1$.
Another thing to consider is that by the Poincare inequality, it follows that also $u$ is $L^2$-bounded (by the same constant $C$). And so the Sobolev norm of $u$, which is equal to the $L^2$ norm of $u$ plus the $L^2$ norm of $u'$, is bounded. Can we conclude something with this fact? Hints are also welcome
By the Poincaré inequality, the set $B$ is bounded in $W^{1,2}_0$. Since the embedding $W^{1,2}_0\to L^2$ is compact (this is known as Rellich or Kondrachov embedding theorem), the set $B$ is strongly (and thus also weakly) precompact in $L^2$.
It remains to show that $B$ is weakly closed in $L^2$. Let $(u_n)$ be a sequence in $B$ converging weakly to $u$ in $L^2$. Since $B$ is bounded, there exists a subsequence $(u_{n_k})$ converging weakly in $W^{1,2}_0$, and since weak convergence in $W^{1,2}_0$ implies weak convergence in $L^2$, the weak limit in $W^{1,2}_0$ is actually $u$. Thus $u\in W^{1,2}_0$ and $\|u'\|_2\leq \liminf_{n\to\infty}\|u_n'\|_2\leq 1$.
In the case $n=1$ one actually gets a stronger compactness property. This is because $W^{1,2}_0(0,1)$ embeds continuously into the Hölder space $C^{0,1/2}([0,1])$, and by Arzela-Ascoli, the embedding $C^{0,1/2}([0,1])\to C([0,1])$ is compact. Hence $B$ is compact in $C([0,1])$.