For the most part, it is very easy to determine the original intent of a building code, especially relative to some other varieties of laws.
The enforcers of the building code sometimes betray that intent. This is unfortunate, but there is little that a legislator can do to control a cop or county inspector that may be separated from the consideration of the bill by time, distance, wisdom, and attitude.
Building codes do little good if they are not updated frequently, and appropriate for economic conditions. Earthquake-safe architecture in all residential buildings is not appropriate for Haiti, but it may be for vital infrastructure, such as water treatment plants, ports, power plants, and hospitals.
Thanks to changes in U.S. economic conditions, it may be necessary to revise building codes to make it easier for people to buy new homes costing $40k or less, rather than go deep into debt for an existing home with median price $230k. It does no good to mandate by law that the worst possible home that can be built is still too expensive for anyone to buy.
It should be obvious that one guy building shelters from scratch in the outback is not going to significantly affect the housing market. But there's always that one guy, that power-tripping bureaucrat out to make an example of someone, who ruins it. The problem is not the building codes. It's that guy, who uses them as a club to enforce conformity, rather than as a standard which may accommodate reasonable variances.
It's because of that guy that building codes should not have the force of law. You just can't put the power to knock someone else's house down in the hands of a jerk or an idiot.