Where does a building code EVER mention cost? The amount of material testing that has gone into finding the minimum needed to maintain support is extensive, but builders & contractors (usually plumbing, electrical and HVAC) ignore some of the requirements. The things I have seen in houses that were done after final inspection were bad enough but I have seen some things done before the walls were rocked that likely cost people their jobs. In one house, the electrician ran all of the Romex from the second floor in the same stud cavity as the cable for the lightning suppression- even bundled everything together. One direct lightning strike and the whole thing would have been history. I have also seen where floor joists were hogged out so pipes, wiring and ducts could be run, but the requirements are specific- any holes in a joist must be in the middle third and any time it exceeds that, material must be added, to make up for the loss of stiffness and strength. Allowances for location WRT the distance to the end of the joist can be made, but only if the holes are small.
Personally, I wouldn't buy a house knowing that it was built using lumber from one of the major home building supply stores because their framing materials and sheet goods suck- the moisture content is too high and it's some of the worst crap I have seen and struggled with. Spongy floors in a new house are a good sign that someone screwed up- whether it was intentional or not remained to be seen.
My house was built by idiots and at least one former owner was even worse. I, OTOH, seem to have gone blind when I looked at it before buying.