Software is more then just code. There are communities and ecosystems around it. When you release software you gain goodwill which is worth money to the right buyer. And all your users are good upsale and marketing targets. An unscrupulous company can take your code, win users over by marketing their fork, and if there is no copyleft they can implement extra features that only exist in their version.
I think you are just talking about a situation where someone forks an open source code into a private one. But the original author still has the code. If someone steals my house but I get to keep my copy… nobody has lost anything.
I don’t think analogies to physical objects work all that well for software.