I've been reading some stuff by Sadhu Sundar Singh (Sadhu = a traveling holy man). Some of his thoughts on why pain exists are worth thinking on.
The silkworm struggles within the imprisonment
of its cocoon, but this very struggle gives strength to
its wings. If we open the cocoon and prematurely free
the imprisoned creature, it will not have the strength
for its new life and it will die. So God’s children
struggle in this world and in that struggle become
strong and fit for the life that awaits them...
We can only really appreciate
the blessings of comfort if we also experience
the agony of affliction; the pleasure of sweetness,
only when we taste the bitter; the value of the good,
only when we encounter the evil; the worth of life, only
when we pass through death. Misfortune and hardships
in this life keep our spirits wakeful so that we do not
abandon our true destiny and become comfortable
in this fleeting world...
If a newborn child does not cry out and scream,
then it must be slapped until it does. No one has joy in
slapping a child – only the longing that it makes full
use of its lungs and draws in life-giving air. So in perfect
love, God may strike us with blows and stings of
pain so that the breath of prayer flows freely through
the lungs of our souls.