A couple thoughts on this. 1) Most projects aren't expecting to be around in 20 years much less 10 and are built accordingly. 5 year old codebases are old and typically are replaced.
2) The ease of change is both the biggest strength and the biggest weakness of coding projects. If you're building a ship, nobody is asking for changes to the plan on a weekly basis. This ability to change rapidly has been emphasized by agile and lean startup methodologies. 3) Few projects know exactly what they're going to look like, what features will be used. Construction projects will have blueprints that are followed. 4) You're probably assuming that these projects are better managed. I'm not sure that's the case. Many houses will have problems where things weren't constructed properly such as bad wiring.
Coding projects do have techniques that can be followed including automated testing, and writing specs