Why do we try to reduce the thickness of the boundary layer over an aerofoil as much as possible if the boundary layer is responsible for creating lift?
You're right--the boundary layer is related to lift production since, in a subsonic example, "guides" the air relative to the airfoil shape and enables the necessary flow accelerations that create the pressure differential and downwash. However, a thick boundary layer is not necessarily a good deal, especially on an airplane wing.
I think that this answer makes a good reference here. The thicker than a boundary layer is, the greater the velocity and pressure gradient across it. Therefore, the chance of flow separation (think of stall, when flow is no longer following the airfoil contour and is creating a ton of drag and not much lift) is also higher.
This consideration is further outlined here, in a master's thesis from TU Delft (a major technical university in the Netherlands). If the boundary layer is allowed to grow and is allowed to remain laminar, separation occurs relatively early, leading to dramatically increased drag and a similar reduction in lift. Artificial "tripping" (i.e., the introduction of turbulence) of the boundary layer prior to laminar separation re-energizes the boundary layer and allows it to remain attached for longer. It can also decrease your drag by some amount, but that's another story unto itself. This (or some more active sort of boundary layer control) is what I'm guessing you're referring to when you talk about keeping the boundary layer thin. It is, with the exception of circulation control and insofar as I'm familiar with it, related to energizing the boundary layer to delay flow separation as long as possible.
I wouldn't say that the boundary layer is responsible for creating lift, even if the real world friction enables the creation of circulation and therefore lift. It is mainly responsible for the drag.
Why? Take a look at airfoils in potential flow: they have lift but neither drag nor a boundary layer. Lift is created due to a pressure difference between the upper and lower side of an airfoil and you don't need any boundary layer to explain this pressure difference.
However, you do need a boundary layer to explain drag. The no-slip condition on the airfoil surface creates a layer with a high velocity gradient (from zero on the surface to $V_\infty$- the freestream velocity). Its thickness depends mainly on the viscosity the fluid around the airfoil:
- No viscosity at all means no energy loss and therefore no drag.The velocity gradient can be infinite and the layer thickness is zero.
- With higher viscosity the particles won't be able to follow such high velocity gradients and the distance between the no-slip surface to the freestream flow around the airfoil will be bigger: the boundary layer will be thicker. The drag will be higher too.