This topic comes up on all three of the RV forums I frequent. We've owned TT's and motorhomes and it is no question that quality in construction is lacking in many RV's. I believe that even with those companies that seem to build the better quality units, there is an overall lack of QA/QC in their manufacturing process.
Much of this is just simple economics. Today's RV buyers want fully featured, sometimes glitzy, RV's. I think many folks want their RV to be equal to or better than their stick built homes in terms of features and finishes. Manufacturers are faced with tying to give the customer what is a very complex, feature-packed RV at a price that buyers can afford to pay. Also, it is no question that the RV industry is very vulnerable to swings in the economy so they are making and selling as many as they can while they can. Make them as fast as you can, get them out the door, make more.
The enemy of quality is variation. If manufacturers could focus on building RV's with fewer variances (only one or two floor plans, standard features across the line, etc.) build quality might improve due to better standardization. However, we all know that buyers want more options not fewer. If we could live with a more spartan RV that is like most of the other RV's around, they might be built more sturdily.
Regardless, what seems to have worked for us is to buy used motorhomes. Our current rig was more high end and is built very well. No staples holding the cabinets together (glued and screwed together), heavier materials, attention to construction detail, well organized wiring and plumbing, etc. We have been blessed to find some really good independent repair shops and a few really good mobile RV techs to fix things I can't fix.
All that said, owning a motorized RV is an expensive proposition and not for the faint of heart. It comes with a full dose of rewards and frustrations.