> some rich people did to get richer
As I said, it all comes from scarcity. Things that are abundant are monetary worthless, and if everything is free, then people don't need to make money, ergo no copyright anymore (there's a slight simplification here actually, because copyrights also grant control, which is actively thought). That said, while the system is mostly used by the richest, poor people can profit from it as well, if they manage to produce valuable IP.
The problem that we really have here imho is that code is just logic written in an often clever way, like a math theorem. Do we want to have these things protected by copyrights or patents? Does it make sense? That's the real question behind the issue at hand I believe.