The purpose has to do with the glory of God.
Creation, is a pretty much infinitely complex system arising out of a few simple principles. Physically speaking, we have space-time, and the four basic interactions of nature and the Law of Thermodynamics that go with it. The material universe is not all there is but is necessary to make us persons.
Our rational mind, connects the eternity of the Now, on which it is grounded, to the flow of change. Rather than being a mere spectator, our spirit may be understood as bringing about the existence of objects within the flux of the whole that is all space-time. Our ego, who and what we think we are in relation to the world is an expression of our human soul.
The soul, although emerging from what is changeless, is continuously changing in life. It does so through our actions, by which we decide the person we want to be within the passage of time. Humanity as a species has decided to make ourselves gods. Since God is Love, perfect relationality, union in the act of giving all to the other, to be gods is to ultimately divest ourselves of our very being. At the beginning of time, we have chosen the cross; we will give back to God the life we have been given, and thereby will know to the core of our being, not merely intellectually, the nature of good and evil. This has resulted from the choice of first temporal and ontological manifestation of humanity, to be a god without God at the centre of our being. Lost in the wilderness of an existence disconnected from love, a desert that is desert in every which direction, we cry out to God, who quenches our thirst and in Jesus Christ, the bread of eternal life, we are reunited with the Centre who is Existence itself - the Triune Godhead.
The purpose of all this is to become our true selves, loving, Christ-like, and it is thereby that creation communes with the Divine.