I've thought about this a bit and there seem some patterns that keep returning in human behaviour and the first one is very common.
The tribal mentality
In the ancient past humans lived in small groups and that group was everything to them, their family their survival etc. If anybody from the outside came they were probably a threat and needed to be fought off. This mentality helped form a bond between all the members of the group and helped them survive against outside threats.
But today it seems to do only harm. Of course the example that many use is when Hitler spread his message across a Germany that was in a terrible economic situation and also had been humiliated and used the discontent to blame everything on one group of people. They're the others they're less than human they're evil and twisted, they're responsible for everything that's wrong with our country etc. But honestly you can see this behaviour everywhere you look. It's not exactly to the same degree as Hitler of course but it's everywhere.
In Greece where the economic situation is terrible the extreme right wing party has seen a huge increase in support. Whenever people are scared or struggling and somebody comes along with somebody to blame many people buy into that.
You can see this mentality in religious conflicts, in civil wars between ethnic groups, in elections even in sports teams pretty much everywhere you look.
We like to think we're sophisticated and advanced but at the same time we still behave like monkeys or cavemen and many people don't even notice it.
Peer pressure and social acceptance
I'll make this one short because everybody knows what it is :P. A group can normalise a behaviour that people would normally be against. A white supremacist who later left and is now quite liberal said that he got pulled in because they never really told him it was about hate, they were just proud of being white and belonging to the group was a good feeling it was like church he said a community.
Milgram Experiment and dilution of responsibility
I will take two things into one in this second point. Another thing that has contributed to so much suffering has to be the hierarchy structure and how the responsibility for terrible actions is not solely on one person. The Experiment that has fascinated many people and been made into movies etc was about obedience. They tested if the subjects would continue to follow orders even if they thought they were causing severe pain to somebody. 65 % never stopped giving shocks to a person even when they heard screaming etc. They followed the orders of the scientists even though they weren't getting paid they had been told they could leave etc. In some cases it was even 80 %.
The people knew it was bad and they felt guilty and were suffering but they didn't stop. Maybe this is another survival mechanism from our past. There couldn't be too much disobedience in a tribe or the whole group would perish. If there was a fight with another tribe everybody had to kill or be killed there couldn't be any discussion or hesitation. Even if the people didn't want to kill anybody they had to. So there were only a few who thought for themselves and maybe challenged the leader but everybody else fell in line.
This gets even worse when it's combined with another factor the dilution of responsibility in a hierarchy. "I was jut following orders" etc. The people who worked at a concentration camp how did they live with themselves ? The people who order genocide how do they sleep at night ? Nobody thinks they're fully responsible. The people who give the orders don't do the dirty work and the people who do the dirty work just follow orders.
There was a case that really saddened me some years ago. A father had a youn daughter who was very sick here's the whole link if you want to see it.
She had a good chance to survive but the treatment was very expensive, he had health insurance through his company but they fired him right before a operation. To prevent this the coverage extends past the firing but the insurance system in the U.S. is based on denying claims. They send it back and forth between different divisions of the company and the system is set up to make as many people as possible give up on the insurance so they can make more profit. In the end even though he had insurance and they should have paid the little girl died. I'm sure none of the people who did this feel responsible for it. Not the people who set up the system or the people who denied all the claims but they killed this girl for money that's the truth. Of course he won a huge lawsuit but I don't think he cares about the money in the slightest.
This kind of behaviour is part of humanity. I know many people want to see humanity as good but the truth is we really aren't that good, we're slightly more intelligent animals.
I think maybe if people are more aware of these kinds of tendencies they can stop themselves if they're ever in this kind of a situation. Don't just follow along because everybody else is doing it or because you don't want to cause trouble.