A huge feature of copyright is that it is time-limited. When the copyright period expires, it passes into the public domain and belongs to everybody.
There are two major things that undermine this for software: copyright durations, and lack of source code. Software copyright durations should be at most a few years, and to be eligible for copyright, software should have its source code published or at minimum held in escrow, so that when the copyright expires it is still useful.
We already require patents to be published in exchange for the protection we give them; software copyright needs to be the same.
Llms are getting quite good at decompiling things to idiomatic code. How much better do they have to get before open source is a moot point?