A long-held Christian belief is that unearned suffering is redemptive. Dostoevsky believed that himself. The character articulating those thoughts you quote is meant to illustrate the meaninglessly of a life without a deity.
“Without God all things are permissible,” Fyodor wrote elsewhere. Without a deity, any attempt to establish “moral and legal justice” at best simply depends on a human institution or at worst trusts a human intuition.
I do not know if there is God, especially the CHRISTIAN one. But a world without him is no better than with him and perhaps a great deal worse. Suffering for its own sake seems even more pointless.
Suffering is no easier for the non-believer than the believer. If I cannot answer why God allows suffering, the atheist can see no comfort beyond what we can extend to one another.
Of course, the Buddha had some fairly clear thoughts on the nature of sufferings and the way away from them.