One purpose of suffering: homesickness!
I was talking with someone the other day who was having difficulty understanding how there could be any purpose to the suffering they were having to endure. I pointed out that there can be no question but that trials and sufferings here cause us to think more about our heavenly home.
In the midst of Job's great sufferings he said, "For I know that my redeemer liveth, and that he shall stand at the at the latter day upon the earth: and though after my skin worms destroy this body, yet in my flesh I shall see God" (Job 19:24-25).
When the disciples were grieving after Jesus told them He was going away, He comforted them with the truth about their home above. "Let not your heart be troubled: ye believe in God, believe also in me. In my Father's house are many mansions: if it were not so, I would have told you. I go and prepare a place for you. And if I go and prepare a place for you, I will come again, and receive you unto myself, that where I am, there ye may be also" (John 14:1-3).