The codes can be a bit of a problem but it's usually minor (like requiring sprinklers where they didn't before, adds $10k, etc - though enough of these and it adds up).
In most places its the bureaucracy - sometimes two cities with identical rules on the books will be completely different, because one is using permits and permit re-application fees as a major budget item, the other has one inspector who is always gone fishing.