I've been having ongoing discussions about this topic because I had a similar opinion to begin with. The problem is the way a lot of that source code they're trying not to share is licensed.
A lot of the code causing problems is not RedHat's to choose not to distribute. It is Free and Open Source Software licensed under the GPL, a copyleft license that explicitly grants the rights to copy, redistribute, modify as you see fit... as long as the resulting code is also licensed under the GPL. Reason being, this promotes a benefit for EVERYONE, vs. a benefit for a corporate bank account.
While RedHat is not explicitly stopping people from distributing GPL licensed code found within their products, they are saying "well you can, but if you do we're going to stop providing our service to you." They're strongarming people into not exercising rights explicitly granted to them based on the way code RHEL is using is licensed.
This course of action is not technically against the GPL, but... I'm sure you can see how it's a very shitty thing to do.
Imagine you went to a donut shop and they had a buy 1 get 1 free offer, so you go buy a donut and get a free donut that you want to share with your friend. But the person at the counter stops you from giving the donut to your friend, saying "Woah, we gave YOU that donut. You can't just give it away. If you give your friend that donut either you'll have to pay for it or they will, or you'll be banned from the store and you can never buy another donut from us again." That's a shitty oversimplified analogy of what's happening here, but I think it gets the point across.