I think rewrites are popular in part because during rewrite it is possible to drop features, either voluntarily or because of deadlines, while it would probably never fly to drop feature from working, existing implementation.
Also your theory doesn't hold up for cases when you rewrite your own code. I've rewritten my old code hundreds of time because I was "idiot" in a sense that it was unmaintainable with new changed requirements.
A rewrite enables dropping features including, but not limited to: checks and balances, due process, a government for and by the people, and certain inalienable rights.
And just to make it clear: I am not being facetious, I am very concerned that all of these are under serious attack.
Checks and balances are already broken because of DOGE, because the Department of Justice simply ignored a court order to stop the funding freeze, and because the firing of FBI career employees was probably illegal [1].
Due process is coming under serious threat due to the building of camps in Guantanamo and El Salvador, where detainees will likely have insufficient access to legal counsel.
A government for and by the people will be replaced by fascist "network states", sovereign territorial entities under authoritarian control by a "CEO", i.e. dictator [2]. The goal is to enable ultra-wealthy individuals to freely "exit" democracies, to live and govern without any rules.
Inalienable rights are explicitly under attack by the ultra-libertarians in Musk's circles. Nick Land, one of the main thinkers behind this neo-fascist brand of thought (branding it as "Dark Enlightenment"), quotes Patri Friedman, who runs Pronomos Capital, the corporation that builds these network states for Peter Thiel and others:
> Patri Friedman remarks: “we think that free exit is so important that we’ve called it the only Universal Human Right.” [3]
Id est, building a privately-owned, corporate-controlled, dictatorial "network state", which is exactly what "free exit" means, justifies abolishing all human rights.
The worst thing is that this all sounds like an insane conspiracy theory, but this is operating completely in the open. The statements of Peter Thiel, Patri Friedman and others are freely available, and they make very clear (Peter Thiel):
> Most importantly, I no longer believe that freedom and democracy are compatible. [4]
Also your theory doesn't hold up for cases when you rewrite your own code. I've rewritten my old code hundreds of time because I was "idiot" in a sense that it was unmaintainable with new changed requirements.
Rewrites are sometimes necessary.