Rashi asked this question, too. The famed Bible commentator Rashi wrote:
“In the beginning…,” the Torah should have only had to begin with
“This month shall be to you…” (Exodus 12:2) which is the first of the
commandments that Israel was instructed. And why did it begin with
"Because of “He has told of the strength of Hid deeds to His people, to
grant them the heritage of nations” (Psalms 111:6); that if the
nations of the world should say to Israel, “You are robbers, that you
conquered the land of seven nations,” Israel shall respond to them,
“All the land belongs to the Holy One; He created it, and gives it to
whoever He deems appropriate. By His will, He gave it to them, and by
His will, He took it from them and gave it to us.”
Rashi to Genesis 1:1 (relying on a Midrash)
Rashi is saying that the Torah begins with the Creation story to teach people that G-d created the world, it belongs to Him alone, He can do what He wants with it, and He gave the land of Israel to the Jews (Abraham). No one should argue with G-d's decision. The story narratives about the deluge, patriarchs, and Exodus serve as context and other means. Why didn’t the Torah begin with the first commandment in Exodus? Because the Torah is not a history book. It’s a guidebook, toras chaim. The Torah teaches theological, political, and moral messages about G-d and laws.
In contrast, Rambam felt that the Torah did begin with the first commandment. He did not read Genesis 1 literally but as a parable, teaching that the term, “image of G-d” means that people are like G-d in the sense that they can think.
The Mishneh Torah begins with the first fundamental principle of Judaism:
“The foundation of all foundations and the pillar of wisdom is to know
that there is a primary being [G-d] who brought into being all
Notice that he does not say to believe in G-d, but to know that G-d exists (Exodus 20:2). How does one get to know G-d? By studying the sciences. Thus Genesis 1 promotes the learning of physics.
Maimonides said, “The only path to knowing G-d is through science—and for that reason the Bible opens with a description of the creation.” (See Gerald Schroeder, The Science of G-d, at vi, 17.)