Lens design as everyone has noted is limiting and to me the major problem we have is not being able to preserve the kind of quality when stopping down past f8.
In fact, most produced lenses are zooms, wide-angles and cheap kit lenses for inexpensive cameras. It is very difficult to minimize aberrations under those constraints (size, price...). You can get a diffraction-limited lens at f/4 on axis, but take a look at the price of a Leica lens or a fine telephoto lens from Canon.
You have a good example in the new Zuiko lenses for the micro 4/3 Olympus camera. The 25mm f/2.8 is reported to be not as good as it was expected. It isn't a superfast lens, the format is small... so, what is the problem? I think the cost/price may have been a serious constraint in the design of the lens, besides the size and maybe the contrast based AF of the camera (constraints on the total weight of the lens elements?). You can design and manufacture a much better lens than the Zuiko, but it is not easy if you work under cost limits, size limits, etc. Then, mass-produced lenses and cameras have a different set of constraints than cameras for special applications of even cameras for professional applications. Diffraction problems can be a limiting factor for most of the cameras produced.