The question is not why God allows us to suffer. The question we ought to be asking is why God allows us to live. The answer to that question is easy: He wants us to repent and seek him.
The Bible equates seeking God with obeying his commands. King Jehosaphat “sought the God of his ancestors and obeyed his commands” 2 Chr 17.4.