How can a loving God make a deal with the devil? In the book of Job, as best as I can see, God ruined Job's life over a bet (Job 1:9-12, 2:4-6). People and livestock who weren't even involved died (Job 1:13-19). Moreover, God literally made this deal with the devil.

It seems that Job's life (and the lives of his children and livestock) is just a game or one big cosmic joke to God and Satan. We can explain Satan's behavior by saying he's evil. But God is supposed to be all-good and all-loving.

How do Christians reconcile God's bet with Satan with a God of love?

Important Note:
This question is not about the problem of evil. It has nothing to do with Job. It's about God's behavior in the book of Job, i.e. the bet with Satan. If your answer has anything to do with why the righteous suffer, you're probably answering the wrong question.
First a disclaimer – 

Your question is another form of the renowned problem of evil. How can God be loving and kind in light of all the suffering that exists in the world?  

It is easy to try to give over simplifying answers especially when I myself haven’t gone through the problems many other people have to face. I do not think I can fully answer your question, all I can offer is some speculative arguments.

End of disclaimer.

The problem of evil is not an easy one and as such one could not expect its answer to be simple (And not expect it to come from a simpleton like me). The problem has been dealt innumerable times by many Philosophers and Apologists. 

Leibniz and Lewis come to mind. (I would recommend The Problem of Pain)
Nor is the problem essentially a new one. Even the prophets of God had the same confusion – 


  Habakkuk 1:2 How long, LORD, must I call for help, but you do not
  listen? Or cry out to you, “Violence!” but you do not save? 3 Why do
  you make me look at injustice? Why do you tolerate wrongdoing?


I think the crux of your question is the premise that humans are innocent until they do something very terrible like murder.


  Innocent people and livestock died.


And it is this premise that I'll focus on – 


We all think ourselves to be quite innocent. There are a few faults
here and there but there’s a good reason for those.


  Proverbs 16:2 All a man's ways seem innocent to him, but motives are
  weighed by the LORD.


All our goodness is accidental or circumstantial. I have never
stolen anything in my life. Though I'd like to believe it's all
because of my good nature it might be because I've never really
needed to. While we humans can only look on the external actions of a
person and make our judgement on that basis, God is not fooled by
appearances. 

By the way of an analogy the user of a software system can only tell
if a program malfunctions by analyzing the output. On the other hand
a programmer can read the code and make an estimated guess if the
code will actually work. Badly written code executing in an ideal
environment may work. While a code of mathematical precision may
break under extensive regression test. In these cases a programmer
is (and as God is in our case) - not fooled.

It is in this context that He says - 


  Matthew 23:26 I tell you the truth, the tax collectors and the prostitutes are
  entering the kingdom of God ahead of you.


And - 


  Matthew 23:6 " ... first clean the inside of the cup"

Our sense of goodness is in out of touch with reality. Have you ever
watched a documentary on Khmer rouge or the war crimes in World War
II?


  Innocence is the last characteristic one could attribute to the human
  race. - Monika Michael


And - 


  1 John 1:10 If we say that we have not sinned, we make him a liar, and
  his word is not in us.


Also - 


  The more I know of men, the more I respect dogs. (Author Monika can't
  remember)


And also - 


  Jeremiah 17:9 The human heart is the most deceitful of all things, and
  desperately wicked. Who really knows how bad it is?

God does not owe His salvation or His favor to anyone. Nor does He
need to explain Himself to anyone.


  Psalm 50:12 ... all the world is mine and everything in it.
  
  Matthew 20:15  I will have mercy on whom I have mercy, and I will have
  compassion on whom I have compassion.



Now directly onto your question. We don't know exactly what happened, we aren't given much information. There are two possibilities (in my mind) -  


Perhaps Job's sons were wicked, not God fearing like their father. (Example,
David and Solomon, Eli the high priest and his wicked sons) And God
decided to use the situation and kill two birds with one stone. Bring
judgement on his sons and set a personal matter straight with Satan.

In the end all things even those not in approval to His immediate commands
will accomplish only His purpose.
Perhaps Job's sons were not wicked. They died in a dramatic fashion and so we ask the
question - what was their sin? Again we're judging based on
appearances. If someone dies quickly we think it's because of sin.
If someone dies by age we thinks its all right.

The fact is that we all have sinned and are going to die one day or
another. The timing of our death has nothing to do with it.  The
righteous may live few days and the wicked may flourish (I'm in my
full old testament rhythm today) but in the end each man will get
what he deserves.

The Apostle Peter was not rescued from the prison because he
was sinless but so that he might preach the gospel. When he had
finished his job he did have to die. Similarly maybe Job's sons were innocent as you say. But they did have to give up their souls to God one day. He took it early. Whether he takes it right now or 60 years later is His prerogative.

In the end all I can say is - 


  Romans 9:20 But who are you, O man, to talk back to God?


Perhaps Jobs sons were holy and righteous (like me) and they died,
well then - 


  Philippians 1:23 I desire to depart and be with Christ, which is better by far;