A second reason is to avoid discrimination. Applicants that feel disadvantaged, even if they are actually qualified, may hesitate to negotiate for a higher salary in the same way that a other applicants would. The consequence is that they start with a lower salary. This applies specially to women. Plenty of research shows that they are less likely to negotiate their salary.
Research[1] suggests that pay transparency leads to lower average salaries because employers avoid paying higher wages to any one employee to avoid costly negotiations with others. The effect is small, around 2%, and it disappears with increasing degree of unionization. In my opinion this is an acceptable price to pay to reduce pay inequality, which often is much more than 2%. It is also a good argument for joining a union.
I've tried the opposite, paid everyone the same. But there were clear differences in ability and more importantly outside options. It became a problem when it came to retention and the business didn't have the ability to overpay everyone to keep the top performers.
If you want juniors to fill out your team, why are you getting a bunch of seniors?
It's very hard for people to accept that this might even be the case, many people just assume that transparency is better for workers.
A company has a fixed amount of money it can spend on wages. Reducing wage inequality means paying less to the best employees and more to the others, which is great if you just want to slack off but terrible if you're already one of the highest paid employees.