There is a pretty good argument that this should be required for copyright protection. The point of copyright is supposed to be to ultimately get works for the public ___domain, when the copyright expires. If the source code has never been released then it's failing at its purpose. Once a work is in the public ___domain the public is supposed to be able to make derivatives etc. So to have copyright protection for software you should have to release the source code.
A noble idea, but it should be pointed out that of all of the software ever written on planet Earth, only Ada Lovelace's somewhat notional code for a non-existent machine would be in the public ___domain in the year 2024. The earliest you would expect to see "modern" code entering the public ___domain is sometime in the 2060s, and that would be written in Plankalkül.
Obviously, if we’d like to require programmers to release software in source code form then we’re going to need some rules. If programmers are made to release software in some source code form then what languages should we require? Clearly, Brainfuck is out of the question, for example. Though, it would do no good to legislate the programming community into a religious war over FP or OOP. My proposal, however modest, is that the law require software be released in some kind of well-specified, portable language. Something succinct and powerful. Something symbolic, abstract, and much higher-level than the underlying hardware. Hm. How about x86_64 machine code?
That's generally handled with a "preferred form" clause -- it must be released in the form it was written in. If you originally wrote the firmware in Brainfuck, it's fine to release in Brainfuck. But you can't transpile to Brainfuck and release that.