12. Why are pain and pleasure so connected to the biological goals of survival and reproduction, but morally random? Is there some greater good that logically requires (or logically requires risking) that suffering be used to motivate animals to pursue the biological goal of self-preservation? Does some moral end make it desierable for suffering to continue even when it serves no biological purpose? For example, why do sentient beings, including animals which are not moral agents, experience pain or pleasure that we do not know to be biologically useful?
The goal of self-preservation is not what the purpose of life. Suffering in life is not for a biological purpose. The reason for the confusion is that we need to know why creation is subjected to suffering and why.
18 I consider that our present sufferings are not worth comparing with the glory that will be revealed in us. 19 For the creation waits in eager expectation for the children of God to be revealed. 20 For the creation was subjected to frustration, not by its own choice, but by the will of the one who subjected it, in hope 21 that[h] the creation itself will be liberated from its bondage to decay and brought into the freedom and glory of the children of God.
22 We know that the whole creation has been groaning as in the pains of childbirth right up to the present time. 23 Not only so, but we ourselves, who have the firstfruits of the Spirit, groan inwardly as we wait eagerly for our adoption to sonship, the redemption of our bodies. 24 For in this hope we were saved. But hope that is seen is no hope at all. Who hopes for what they already have? 25 But if we hope for what we do not yet have, we wait for it patiently.
26 In the same way, the Spirit helps us in our weakness. We do not know what we ought to pray for, but the Spirit himself intercedes for us through wordless groans. 27 And he who searches our heartsknows the mind of the Spirit, because the Spirit intercedes for God’s people in accordance with the will of God.
28 And we know that in all things God works for the good of those who love him, who[i] have been called according to his purpose. 29 For those God foreknew he also predestined to be conformed to the image of his Son, that he might be the firstborn among many brothers and sisters. 30 And those he predestined, he also called; those he called, he also justified; those he justified, he also glorified. - Romans 8:18-30
The Secular Outpost: 20+ Questions for Theists