Its great to see others searching these mysteries. I love the stories of Sophia and in my mind, Sophias offspring explains why this world is the way
First I think youll find this, its Wisdom of Solomon
Some snips about wisdom from the above link-
 Wisdom is radiant and unfading,
and she is easily discerned by those who love her,
and is found by those who seek her.
 She hastens to make herself known to those who desire her.
 He who rises early to seek her will have no difficulty,
for he will find her sitting at his gates.
 To fix one's thought on her is perfect understanding,
and he who is vigilant on her account will
soon be free from care,
 because she goes about seeking those worthy of her,
and she graciously appears to them in their paths,
and meets them in every thought.
 The beginning of wisdom is the most sincere
desire for instruction,
and concern for instruction is love of her,
 and love of her is the keeping of her laws,
and giving heed to her laws is assurance of immortality,
 and immortality brings one near to God;
 so the desire for wisdom leads to a kingdom.
Here is a link to Pistis Sophia to the Nag Hammad Library
Here is a link to 'Origin of the world (its actually an untitled text)
Seeing that everybody, gods of the world and mankind, says that nothing existed prior to chaos, I, in distinction to them, shall demonstrate that they
are all mistaken, because they are not acquainted with the origin of chaos, nor with its root. Here is the demonstration.
How well it suits all men, on the subject of chaos, to say that it is a kind of darkness! But in fact it comes from a shadow, which has been called by
the name 'darkness'. And the shadow comes from a product that has existed since the beginning. It is, moreover, clear that it existed before chaos
came into being, and that the latter is posterior to the first product. Let us therefore concern ourselves with the facts of the matter; and
furthermore, with the first product, from which chaos was projected. And in this way the truth will be clearly demonstrated.
After the natural structure of the immortal beings had completely developed out of the infinite, a likeness then emanated from Pistis (Faith); it is
called Sophia (Wisdom). It exercised volition and became a product resembling the primeval light. And immediately her will manifested itself as a
likeness of heaven, having an unimaginable magnitude; it was between the immortal beings and those things that came into being after them, like [...]:
she (Sophia) functioned as a veil dividing mankind from the things above.
Now the eternal realm (aeon) of truth has no shadow outside it, for the limitless light is everywhere within it. But its exterior is shadow, which has
been called by the name 'darkness'. From it, there appeared a force, presiding over the darkness. And the forces that came into being subsequent to
them called the shadow 'the limitless chaos'. From it, every kind of divinity sprouted up [...] together with the entire place, so that also, shadow
is posterior to the first product. It was the abyss that it (shadow) appeared, deriving from the aforementioned Pistis.
Then shadow perceived there was something mightier than it, and felt envy; and when it had become pregnant of its own accord, suddenly it engendered
jealousy. Since that day, the principle of jealousy amongst all the eternal realms and their worlds has been apparent. Now as for that jealousy, it
was found to be an abortion without any spirit in it. Like a shadow, it came into existence in a vast watery substance. Then the bile that had come
into being out of the shadow was thrown into a part of chaos. Since that day, a watery substance has been apparent. And what sank within it flowed
away, being visible in chaos: as with a woman giving birth to a child - all her superfluities flow out; just so, matter came into being out of shadow,
and was projected apart. And it did not depart from chaos; rather, matter was in chaos, being in a part of it.
Here is a link to the Sophia of Jesus Christ-
a snip from the aboce link-
Again, his disciples said: "Tell us clearly how they came down from the invisibilities, from the immortal to the world that dies?"
The perfect Savior said: "Son of Man consented with Sophia, his consort, and revealed a great androgynous light. His male name is designated
'Savior, Begetter of All Things'. His female name is designated 'All-Begettress Sophia'. Some call her 'Pistis'.
"All who come into the world, like a drop from the Light, are sent by him to the world of Almighty, that they might be guarded by him. And the bond
of his forgetfulness bound him by the will of Sophia, that the matter might be through it to the whole world in poverty, concerning his (Almighty's)
arrogance and blindness and the ignorance that he was named. But I came from the places above by the will of the great Light, (I) who escaped from
that bond; I have cut off the work of the robbers; I have awakened that drop that was sent from Sophia, that it might bear much fruit through me, and
be perfected and not again be defective, but be through me, the Great Savior, that his glory might be revealed, so that Sophia might also be
justified in regard to that defect, that her sons might not again become defective but might attain honor and glory and go up to their Father, and
know the words of the masculine Light. And you were sent by the Son, who was sent that you might receive Light, and remove yourselves from the
forgetfulness of the authorities, and that it might not again come to appearance because of you, namely, the unclean rubbing that is from the fearful
fire that came from their fleshly part. Tread upon their malicious intent."
There are several text within the Nag Hammadi library that you will find the story of Sophia within them. So to grasp the full idea, it would be best
to read through them all or search the word Sophia within them.
The Nag Hammadi library is very interesting. Many of these kinds of text were actually accepted by early Christians. Till the uproar and then they