Wager
It actually wasn't a wager.
And although we might hear the term "wager with the devil" in pop culture, that isn't really what happened in job.
It's probably better theology for us to avoid that expression... it makes it sound like God is out of control, and he's just up there shooting dice.
: )
-----
I think Maxwel is right! Certainly, a sovereign God is not making a wager with Satan. Instead, he was showing Satan how wrong he is. And in the process, that God is always in control.
God had a number of distinct purposes in having Satan go after Job. One had to be to show that Job was faithful, in spite of calamity. Another was a witness to the friends. And of course, God knew the book would be a part of our Bible, and it would encourage those who are suffering.
But, more important than those things, are the closing chapters of the book. God describes in great detail, how he is sovereign, and to Job, of all people. Job who did trust God, even though he was hurting. God showed Job, that he is in control, and the most interesting point, is that when Job wants to know why he had to suffer, God never directly answers his question. In the end, Job repents, and yes, God restores him.
I would ask the OP if they have ever read the whole book of Job through? I read it once a year, and every time I get more out of it. The best thing to do is to read the whole Bible, and certainly, Job, once a year. Then, these things will make a lot more sense, than just reading a chapter or a few verses.