Why was there so much violence in the old testament?

In the old testament aka old covenant. When someone died they did not go to Heaven or Hell. They did what the bible terms as “Slept with his fathers” aka soul stayed with the body in a place known as paradise (not heaven just a temporary place). This can term can be found throughout the old testament but completely disappears in the new testament. This is because Jesus made a straight way to Heaven.

Image from a Bible search engine.

So being that the people back then did not receive judgment after death, judgment was often before death. So what we would see as violence was man being judged upon earth. This is why you don’t see this today. Judgment now is after death.