The problem is that the average passer by, John/Jane Doe, doesn’t on average care enough about the abstract reasons why they should withhold judgment, they instead react along the line of “well if they are being investigated they are probably guilty” which is results in the public typically judging anyone dragged into the judicial process.
So it’s actually inverted outcomes from what you described, secret is normally good, (with obvious exceptions, such as the case in point) and public is normally bad.