He suffered everything just so that God could win a bet with the devil.
If that is truly your take, then you misunderstand fundamentally the whole of the Bible and of God.
At the micro level, yes, to win a bet with the devil. However, the macro level is the important one. Millions of believers over the last 4000 years have taken comfort, learned knowledge, wisdom and patience from the Book of Job. God used Job to educate and enlighten untold numbers of people going through whatever painful episode in their life was occurring.
The small amount of time that Job suffered, in view of the eternity of time he will enjoy as a child of God, is not comparable. Romans 8:18