Are we really better off with building codes", has spawned an interesting discussion. "Yes, but...."
The best built house on my street sold last year for considerably less than it cost to build. (I'm not sure when the last house on this street sold for more than its replacement cost, but that's another issue.) The second-best constructed house sold more recently, also for less than it cost to build. They did both sell for more than the house my wife and I purchased last year, but they're selling on par with what you would expect on a "per square foot with finished basement" basis. If you choose to build a house above and beyond code, you can't expect to get much (if any) of that investment back when you sell.
Building codes represent the minimum standard of construction, and in many ways are to home construction what domestic cars in the 1970's were to advanced automotive engineering. Yes, code improvements have increased amounts of insulation typically used and, despite it being true that there are some astonishing homes built over a century ago that put most modern homes to shame, for the most part homes are actually more solid and comfortable than they were a century ago. (It's like music - you focus on the works of art of past generation, but forget how much ended up as noise in history's scrap heap. A lot of older homes exist only due to significant renovation or have been replaced, and it's pretty easy to find older homes that are barely standing.) But if you build to code you're getting a house that's substantially less solid, less energy efficient, and less likely to last than a house that could be built based upon readily available knowledge, materials and building technologies.
I do agree that part of the problem is that it's easy to become a builder, and up until the housing crash was pretty easy to make money building and selling homes on a "maximum square feet for the money" basis using semi-skilled labor. I personally would like to see a concerted effort in developing and implementing new construction technologies that can help make housing better, longer-lasting, more energy efficient and less expensive. But I see little sign that the residential construction industry will collaborate to make that a reality, or that the government will impose something analogous to CAFE on home builders, requiring them to build better homes and thus creating an economic incentive to use, develop and implement better techniques and technologies.