That is a very good question that no one will ever have an answer to, and unfortunately, there is no way to prevent bad things happening to good people. Sometimes they are just in the wrong place at the wrong time, and get caught in the middle of something. Sometimes they are trying to do something good, but it just goes wrong.
For instance, Ben is walking down the street and sees a woman and another man, they do not know each other. The man is heckling the woman and following her and she’s clearly upset and trying to get away from him. Ben intervenes and tries convincing to this man to leave the woman alone. This man will not listen and throws a punch at Ben because he will not leave the situation alone. Ben acts back in self-defense, and before we know it, both of them are in handcuffs.
You see, this sort of stuff happens? Ben was not looking to have a fistfight with another man. He wanted to politely, yet sternly, tell this man to stop bothering the woman. He just spoke up to the wrong guy.