Being cynical, I would say that up to the point the info leaked, you had a good developer at a cheap rate who actually thought he was being paid well. A win win for the manager.
However, I think the way raises are calculated needs to be revised. Currently raises are typically some percent of the salary and the range of percentages is fairly narrow (so the disparity remains constant). If instead raises were calculated with the goal of equalizing the salaries of like-performing employees the disparity would fade in a few years.
The problem with this, of course, is that lower paid employees get larger raises, which may seem unfair to the better paid employees. This can be solved by making salaries more transparent.
Although if salaries were more transparent then you probably wouldn't have as many problems in the first place.
Managers, read up. Do you want to make your team members feel like this? Communicate clearly beforehand about what leads to incentive pay (good code) and disincentive pay (chatty phone calls). If you didn't communicate clearly, you don't get to skimp on labour costs.