A liquid cannot withstand a shear stress. How does this imply that the surface of liquid at rest must be level, i.e., normal to the gravitational force?

If the free surface of the liquid is not perpendicular to the gravitational force, then there will be a component of force along the surface. The liquid will not be at rest in that case.