Computer code is not comparable to a book. A better comparison would be a blueprint or a recipe. If Coca-Cola publishes their recipe wide and far for anybody to read, would you rage together with them when another beverage company starts selling drinks together with them?
Computer code is also not comparable with a wallet thrown onto a busy street corner.
Can you decide, whether you are OK with unfit comparisons or not, instead of trying to have it both ways?