I became a Baal Tsuva many years ago during my service in the United States Navy. The United States military has it’s own legal system. On my ship when someone disobeyed regulations he needed to answer for it and manytimes what he did was made public on the ship to prevent others from doing the same.
Over the years I have noticed that some so called Torah Jews hide behind Halacha. I am far from being an expert on Loshon Hara but if a Torah Jew has a business whose clients are the general public that relies on him, if this Torah Jew breaks a lioca leagal law with another Torah Jew who is paying him money, is it permitted to use a public attourney to help resolve and publisize the situation? This way someone else in the same buisiness might not do the same thing to someone else.
The army may have is own legal system, and they can do things the way they see fit, however from the torah’s perspective, you would not be allowed to do something like that. The reason is because it is embarrassing the other person and speaking lashon hora about him, and taking a public attorney would mean prosecuting him, which would a very serious sin called “mesira”, giving someone over to the local government. Two wrongs don’t make a right. We have to try and prevent things like this, but not by sinning ourselves.
Having said that, there are times when a person is allowed to speak lashon hora in order to prevent other people from getting damaged, however in order to do so there are a number of conditions that have to be met. Some of them are, that you first spoke to the person in private to change his ways, and he still doesn’t want to. (It is also possible that the person doesn’t know the local laws, or he doesn’t really realize that it is against the law).You must also know firsthand what he did that was wrong, (besides, you also have to establish beyond the shadow of a doubt that what he did was indeed wrong). Additionally, your intention has to be only for the benefit of helping the other person and not to avenge the wrongdoer. There are also extreme instances when one may publicize sinners, such as when someone is a public threat. However in such an instance this would not be allowed. Therefore, if there is something wrong that you see someone doing, it would be best to speak to a local Rov about what can be done about it.