Wisdom recognises that there are three things that we need to achieve. First of all our unique separate beingness, then the objective understanding of values, which produces the ability to understand the real quality and value of all things, and then the strength and integrity which is necessary to support the being and the understanding; and it is on earth that these experiences have been made available for us, to a degree which they may not be available for us in any other form of experience. That is why there is a wisdom that is able to grow from the earth which is so valuable.
To recapitulate: the special purpose of life on earth (for those who survive to adulthood, anyway) is related to three types of striving:
1. To develop as unique, distinctive individuals - we are not supposed to conform ourselves into one single pattern. Life is set-up so that we can (and almost must) become ourselves, more and more, by our choices and experiences; so that the Heavenly world has no replicas but instead multiple characters, each of whom is indispensable to the intended ideal.
2. We should develop, by our experiences, an objective understanding of values, based on the fullest possible range of experience. Obviously this does not mean deliberately sinning, nor does it mean scrabbling after experience. But it does mean that life is to be lived, embraced as an adventure (in our own destined way) - not a regrettable thing to be minimized or avoided for fear of doing 'something wrong'. Risk is intrinsic; and even as we do our best we know we will often or usually fail. A recognition of failure and repentance is our greatest friend and infinite saving grace.
3. Strength and integrity to sustain these qualities. In other words, we should aim at a courageous attitude to life - including repentance of our many failures in courage - no matter how timid we are by temperament or circumstance; we know and need to acknowledge as fully as possible that we are supposed to be courageous. Also that there is such a thing as integrity of living, such a thing as knowing what is right and making the correct decisions - this we need to strive for (while recognizing the objective fact that our own integrity is not exactly the same as other peoples' integrity).
In sum - life on earth has been well-designed and planned by God to achieve what he wants us to achieve in terms of our long term, ultimate goal - which is to become ever-more divine in the way that He is divine.
This goal entails a lot of trial and error type learning, which entails a lot of mistakes and failures - because this is the only thing which has the potential (no guarantee) to work for us (you and me, personally.
(Those individuals who do not need this difficult and painful type of learning or who only need a little of it - include some of those who have a very short lifespan, including some of those who die (as divinely foreseen) in the womb or early childhood.)