This is often an argument, but you are thinking about the old testament from todays perspective. Put yourself at that time.
For example, one common one was where Abraham's (I think it was him) son's family is taken by some other tribe. They are running away with them, and Abraham chases them down. He has a much larger army (if I remember correctly), and he slaughters them all (not his family of course). People ask how he could do such a thing, and still be "favored" by God. However the people that ask this are not putting themselves in that era. If he had simply taken back his family, that tribe would surely come back to his house with allies, and kill them. To protect yourself, you had to kill, there was no jails, or law.
Also, remember that in general, before Christ came, the world was a bloodthirsty place. Christianity changed the world to the way it is today.