This question has to be answered as though to someone who believed in god and wanted to understand why there was so much killing in the OT otherwise the answers dont make sense to an atheist. But anyway
.
God created everything, all was perfect until man defied God and got himself thrown out of paradise, where he would then eat by the sweat of his brow and eventually die. But god made a promise before doing this, prophesying that there would be a seed that would crush the evil and give men the choice to return to the perfection he once was.
In order to achieve this, God had to choose a race to carry the seed through time which were the Hebrews and these he centered his attention on, giving them the rules and procedures that would keep them safe, productive, healthy and prosperous. He guided the armies of his people and yes, he was ruthless in some instances, ordering the killing of whole cities etc. and this wasnt always done to prosper the Jews but sometimes to punish them lest they fell away altogether which would ultimately have ruined Gods plan and our salvation. Everything had to be done in a physical way back in the OT until Jesus came and transferred it to the spiritual. The examples of the physical deaths were precursors to the future spiritual deaths (eternal life) for those who do not belong to God.
The death portrayed in the OT was necessary in order to benefit ALL MEN in the long run, because through the Jewish people came Jesus, the promised seed, and the savior of mankind.
God gives and God takes away but everything he does, he does with good reason and for the sake of his creation. If you think he can be judged by our standards then you dont really understand what it is that Christians believe at all.