New and Western
A relatively new kid on the block of questions is this one. And a Western child too.
I cannot imagine many Africans, Indians or Iraqis asking this question, because violence is just a normal part of their life and society. Reading about the violence in the Bible they are more likely to say, "What's so suprising about all this violence, we experience that every week of our lives." or "Wow, isn't this book real to life."
And yet though it's a new question and a Western one, it's worth a good answer in seven parts......
(1) Remember we're judging from the comfort of western peace
That's the first thing any Westerner needs to acknowledge. To a Westerner, any culture, contemporary or ancient, that does not have an ordered police force, justice in the courts and prosperity is likely to be called "violent" or "barbaric" or at least patronisingly "uncivilised". What the Westerner should be asking is "how come we happen to live in peace?" rather than "why do they live in violence?" Because violence has and always will be the norm in the world (any one who wants to deny or dispute this has to switch the TV on or review the 20th century - or any other century, past or future).
The reason we live in peace is explained eloquently by the Indian Vishal Mangalwadi in his wonderful book, The Book That Made Your World. In this book Vishal, who originated from India shows that the reason for Western Civilisation and all the amazing things we enjoy - including peace - is the vast influence of the Bible.
One of the most important books of our times. Violence is the norm, peace is unusual. Instead of condemning what we think are "violent" cultures, we should be grateful for our peace and ask from whence it came.
(2) The Bible is an honest book
The Bible does contain a lot of violence because it is an honest book. It does not whitewash evil like many other annals of antiquity which gloss over the wicked deeds of their heroes. (This was another thing that struck Vishal about the Bible- it was honest compared to the writings of India which glossed over the sins of their own heros).
(3) The civil laws of the OT are not final ethics
Some of the OT laws may seem barbaric to our eyes. But remember they are much better than the surrounding laws of the nations (such as the Babylonian Hammurabi Code, available free on Kindle) but in the end they are not meant to reflect final ethics - that is only found in Jesus. Remember too that Israel was mostly unbelievers and the laws reflect the need for harsh treatment to contain violent tendencies in the absence of regenerate Holy Spirit hearts. Their hearts were hard, said Jesus in Matthew 19, which is why they were allowed to divorce their wives so 'easily'. Divorce was never God's intention, but what do you do when hearts are hard? You have to limit the effects of wicked behaviour rather than try to control it.
(4) Israel was a theocracy under the direct rule of God
The only nation to have that status, and only for a short time. She could act as God's instrument of judgement as she did when she wiped out the wicked Canaanites. If we don't like this, remember God used other nations to judge Israel. There is no nation (not even America) who can claim to be God's Nation, with the authority to judge others. This was the great (but simple) error of the Crusades.
(5) We're not meant to copy much of the evil behaviour
So many OT kings were wicked; they are not examples of what to do, they are examples of what not to do. The violence is there to serve as a warning, not a blueprint.
(6) Sometimes the problem is behind the violence
Sometimes the real problem people have is not with the violence at all, but what is being taught. God judges other nations using Israel: we don't like the fact that God is the Judge. Uzzah dies for touching the ark: we don't like this teaching on the seriousness of sin!
(7) The darkest moment is not in the OT at all
The darkest moment of the Bible is the Crucifixion of Jesus, not because it was the most violent act in all of history, but because this was an Innocent Man, because he was being blamed for our wrongdoing and because he was suffering ultimate death, separation from God - spiritual suffering. This violence was allowed by God because he loved us, and the only way we could be forgiven was if our sin was paid for in full.
For love's sake Jesus became poor and bore upon himself the sin of the world. The darkest moment thus turns out to be the brightest, for through it we may be forgiven for our sins.
If we can look beyond the violence of the Bible to this moment and recognise that it was our sins that put the holy Son of God on a cross, and if we cna trust in this atoning sacrifice, we can find peace with God through faith in his Son.