Why is G-d so cruel in the OT?

I am appalled whenever someone argues that torture can be justified. I am certainly appalled now.