Unfortunately, that is just the way it is. As companies get larger they tend to favor mediocrity over greatness. It is very difficult for them to place an individual value on a developer and thus it's difficult for the developer to "capture" that value.
Also, social dynamics favor not pissing people off over rewarding high performance. For example, they would rather lose a developer X than pay him/her what they're worth because it would be "unfair" to all the other developers that they are currently paying below market.
Of course, raising everyone's salary to reflect market rates "doesn't make sense" in the short term and the short term is what concerns most individuals in the company. If manager Bob gets "good numbers" this quarter, maybe he gets a raise. If manager Bob, keeps down technical debt, attracts good devs and does stuff that in general aligns with the company's long term goals it may not look as good on this quarters numbers.
Your best bet is to go to another company. If you're very lucky, another developer will leave for a lot more money and management will wake up and give you raise. A company I left once gave the remaining developer something like a 50% raise.