One of the contexts in which full transparency is less appropriate is where a business has a legacy of inconsistent approaches to hiring and remuneration, meaning that person A is paid significantly more or less than person B, even though both do the same job at the same level. We might all agree this isn't fair, but at the same time it isn't necessarily something that is easily fixed. A business might simply not be able to afford to fix salary disparity in one hit. Transparency in this context might do more harm than good because it brings the disparity to the fore gives it a focus it would not otherwise have. It reduces the options available to the company that wants to fix this disparity, in particular it reduces the timeframe in which the disparity might be removed.
In fact, this is my recommendation for fixing a problem of salary disparity; institute a policy toward salary adjustment that makes it clear that discrepancies will over time tend to be eliminated. You can be fully open about this policy without disclosing individual salaries, and you can adjust the timeframe to fit your business context. If you're cash-poor you can take longer to fix the problem.
In other words, we should be transparent about the approach to setting and adjusting salaries, but the situation with individual salaries is more complicated.