God, as Maker of the world, knows from all eternity that He wills to be united with Creation in the closest possible likeness to Himself. It is an open debate whether he foreknew the fall and thus willed the Incarnation or willed the Incarnation and thus willed it to have enough "theandric redundancy" to achieve redemption (the old Thomist vs. Scotist-Salesian debate on the order of the Word's mediation).
Anyway, the point is that, in so far as God's knowledge of what it would take to achieve beings capable of the desired participation in His likeness, God thus willed a creation that had every (and obviously displays) every weakness i.e. pain. The potentiality of human nature may thus be both the means of infinite perfectibility in man and, alas, the means of tortured fallenness without that perfected telos.
Pain is a contraction of the Latin patiens, which basically means a metaphysically contingent being. So perhaps "pain", whether the pain of endless glorification or the pain of endless redemption, may indeed be built into the world, like it or not. Christ's suffering is the triune validation of that point: God's love is only known in the tortured flesh of humanity, vouched for by intercession in the Holy Spirit.