No, there are other circumstances, like you have enough money and time to rebuild the whole house to be how you want and make your future better. Of course, other considerations are taken into account, like buying new land and selling the old one, etc... But then that makes the analogy bad.
well, yeah, but all analogies to coding are bad in the sense that they never quite capture everything and coding is honestly just not like anything else.
But at least with respect to emphasising the cost of a rewrite, it gets at it... somewhat :-)
EDIT:
Perhaps it's better to say 'the condition of a house' - there are definitely occasions where a rebuild is necessary. If the foundation is completely screwed, for example.
The idea that you ought never rewrite is mistaken, but it's important not to jump into it.
Maybe the general principle is 'weigh stuff up'. Perhaps too general to be useful, however...