You're basically saying that since open source projects can be reused by others, the people making closed source projects shouldn't complain when the same thing happens to them.
Everyone posting on Stack Overflow knew it would be public and free. Book authors put an explicit copyright notice, which includes derivations of their work.