Why does pressure remain constant in the boundary layer?
There does exist a velocity gradient within the boundary layer.  However, the boundary layer, being a viscous phenomenon, does not obey the Bernoulli equation, which is what trips up our usual intuition
So Where Does Bernoulli Come From?
Bernoulli is a simplification of the Euler equation (which is a simplification of the Navier-Stokes equations).  The Euler equation is an inviscid formulation of the Navier-Stokes equations, and Bernoulli further neglects rotationality and states that the total pressure of a fluid is constant (in steady flow, along a streamline), giving the following expression that we're familiar with:
$\frac{1}{2}\rho v^2+P=const$
This works great outside of the boundary layer, in incompressible (typ. Mach &lt; 0.3), irrotational, inviscid flow...which, conveniently, helps us to understand a good many things that we're interested in (e.g., model airplanes, sailplanes, some GA aircraft, etc.).  However, it has its limits, and one of the many tricks of aerodynamics is knowing the assumptions of your models and when they can and cannot be applied.  This is why panel methods, relatively low-fidelity fluid modeling techniques, are still being used in hydrodynamic modeling.  So long as you don't violate their assumptions, you have a body-fitted model that is faster than more modern finite element or finite volume methods and still gives an accurate result that can be used to predict body loads (and, thus, do performance analysis, etc.).
OK, but why is the pressure still constant?
To the point, Anderson states that pressure is constant through the boundary layer along a line normal to the surface of the body (or airfoil, in this case).  The normal part is important: it means that pressure is not necessarily equal along the length of the airfoil.  Let's look at a small element of fluid moving along the body surface (below) to play with this:

So, pressure gradients drive flow.  If there was no pressure gradient along the length of the airfoil ($P_{right}=P_{left}$), the flow velocity would be zero.  This is not the case, and flow is moving from left to right, therefore, $P_{left}&gt;P_{right}$.  Furthermore, as a result of viscosity, we have a velocity gradient as a move away from the body (e.g., low/zero flow velocity close to the body and increasing flow velocity as we move away from the body through the boundary layer).  This implies shear along the top and bottom of the fluid element in the picture, which corresponds to the pressure difference we mentioned.  However, there is no vertical motion in the boundary layer (there can be in a turbulent boundary layer, but I'm assuming a laminar one for the purposes of this explanation) and no vertical shear.  As a result, $P_{down}$ must equal $P_{up}$ on this element.  If I think with a Newton's 3rd law kind of mindset, the fluid directly above and below this element would feel the same pressure and so on and so forth until you get to either the edge of the boundary layer or the surface of the airfoil.  The assumptions for this fall apart outside of the boundary layer, since there is non-negligible fluid motion towards/away from the airfoil, so that's why I'm stopping the analogy at the edge of the boundary layer.
Hence, along a line normal to the surface, since this does not imply that $P_{up}$ on this element is equal to $P_{up}$ on the element to its left or right, the pressure is constant throughout the boundary layer.
Other references: https://web.mit.edu/hml/ncfmf/10FBL.pdf