What's the 'purpose' of the creation story?
Rashi asked that question, and answered it with a Midrash. An oft-misunderstood Midrash. The key phrase it 'le-eit asher yashar be-einav'.
I was always taught that it means that God can say "I created it, I'll give it to whomever I damn well please". I.e., the purpose of the story is to establish G-d's credentials. I don't - and never have - found this approach to be morally or textually satisfying. No need to go into it here, but I wouldn't be comfortable as a Zionist, or wouldn't be a Zionist, if this were the basis for my claim to the Land of Israel (Emmanuel Levinas has a Talmudic Reading called 'Promised Land or Permitted Land in which he discusses this. Ayen sham. It won't disappoint). And there's the problem of the rest of the book of Bereishis.
But I think that this Midrash means something else entirely. That phrase means "To whomever is upright in God's eyes" as in "Ve-asita Ha-Yashar Ve-haTov be-einei Hashem" - and you shall do what is upright and good in the eyes of God. Going a bit further, the entire book of Bereishis is sometimes called, by Chaza"l, the Sefer Ha-Yashar - the book of the upright (see Netziv's intro to Bereishis. Again, a must read). After each stage of creation, God surveys ("looks") at what he's created and ' sees' (with his eyes?) that it's good!
[maybe R' Gil's big inside joke is that 'Yashar Books' = Sefer Ha-Yashar, his first publication takes it's title from the above-quoted verse 'and you shall do what is upright (right) and good...', and that he's republishing books that were banned because of a violation of the moral rectitude (yashrut) that God expects from the pious, according to the Netziv's introduction, mentioned above. It's too much for coincidence, no?]
Thus, to answer the question that I started with - the story of creation is a MORAL TALE. God creates goodness, meaning, man in his own image - and this sets the bar for humanity to aspire to, to complete the process of creation. The rest of the Torah - beginning with the legal elements recorded in Ha-chodesh Ha-zeh Lachem - are the translation of that Moral Will into a living system, a way to live, a Halakha. The Torah isn't just a book of laws, but an entire moral and spiritual vision-narrative, the sotry of man's relation to the Divine (like Ben Azzai says - 'zeh sefer toldot Adam be-hibaram' is the epitome of the Torah), the unfolding of a covenant, and that story begins when God created the heavens and the earth.
There are a few more elements that reinforce and deepen this idea:
1) Creation is therefore, fittingly, the opening of the book of Bereishis. The rest of the book is about the deal that God makes with humanity immediately after creation, humanity's struggle to live up to their end of the bargain, God's responses to their failings, God's choice of specific individuals to carry on that deal (covenant), and rejection of others. If man can be expected, from the outset, to have some sort of inner moral compass, there must be a model for it. The story of creation is a story of God's love and humanity as an expression and recipient of God's love.
2) Creation was not accidental or impulsive. It's the expression of God's autonomous choice to create. Creation is only meaningful if it's chosen. The Torah communicates this to us by relating that God stopped creating once he created humanity. Shabbat, the cessation of creation, is, paradoxically, the evidence that the creation of the rest of the first week is chosen and therefore meaningful. The are two implications of this for humanity:
a) that creation is still incomplete
b) that the vehicle for ongoing creativity is autonomous choice, not compulsion
(see R' Hutner's first ma'amar on Shabbos in Pachad Yitzchak).
The 'creation' of Shabbat is both the stoppage of creation and a retroactive validation of everything that preceded it, and therefore the creative act par excellence in that it, in essence, allows for the creation of creativity. This dual aspect is the Zachor and Shamor of Shabbat, v'acamo"l.
3) Within the context of the Ancient Near East, the Torah's creation story was 'competing' with other creation narratives. There are definitely some common elements in the various creation narratives, including Bereishis. However, Bereishis is the only one which is not morally neutral, which isn't accidentally precipitated by some kind of power struggle between the gods, which doesn't involve the formation of the world from the corpse of some deity. In Bereishis, this world is purposeful. This world is good. This world is made of progress and creativity, not regression and entropy. Ancient pagans and contemporary scientists would have us believe that the creation of this world is morally neutral, that man is accidental, that goodness isn't real, and that the law of entropy ultimately dooms the universe. Our story of creation stands in stark contrast to these perspectives and proclaims
The skies tell the story
of the Mighty One's great Glory;
And "the works of His hands"
narrate the heavens.