I beams as shear webs
If you think of the rectangular space between the spars and ribs where the shear webs fit, when the wing bends under load this rectangular area wants to become a skewed parallelogram. When this happens the spars shift lengthwise relative to one another, hence the term "shear".
However shear webbing also carries a compression load. When the rectangular area skews the top and bottom spars want to move closer together. In this case vertical grain webbing between the spars can sustain the compression load better than webs glued to the backs of the spars. If the spars can't compress into the space between one another then they can't shift lengthwise in a shearing direction either.
The strongest shear webbing (of a wooden type) would be a laminate of two plys crossed at 90 deg and then cut on the bias. If this is were placed between the spars then the compression load would dominate and the glue strength is less critical. However although the glue joint strength is less critical, the fit is more critical than webs lapped to the sides of the spars.