Then the engineers sharing their salaries with each other should also be reasonable. If anyone complains about the discrepancy, you can point out that the engineers being paid more are more talented.
Extending off of your thought experiment. If you were going to form a startup, and you believed that pay discrepancies corresponded to value, wouldn't you want interviewees to be extremely open about their previous salaries and their salary comparisons within previous companies? That would make it even easier for you to find the engineers who were the most talented. We already ask interviewees where they've worked -- would you feel comfortable asking them "how much money did you make in comparison to your coworkers?"
---
My feeling here is that companies want to hide salaries for the same reason my car mechanic would prefer me not to discuss my bill with any other customers. In an open market, discrepancies in knowledge about market rates favor the people with more knowledge; in this case, the companies. Companies are smart, not stupid; they understand how the market works. They're hiding salaries because that gives them an advantage when trying to drive down the price of engineers.
Whether or not pay discrepancies can be justified is kind of a false conflict. Regardless of whether or not pay discrepancies are a good idea -- in a free market, the prices should be transparent so that companies are forced to compete on honest terms for employees.
A generally applicable question that I've found applies to a number of situations beyond just this one: if a thing is good, then why do we need to hide it or force people to accept it?