Why does the Rambam begin Hilchos Ishus with a history lesson of what marriage looked like before Matan Torah?
קֹדֶם מַתַּן תּוֹרָה הָיָה אָדָם פּוֹגֵעַ אִשָּׁה בַּשּׁוּק אִם רָצָה הוּא וְהִיא לִשָּׂא אוֹתָהּ מַכְנִיסָהּ לְתוֹךְ בֵּיתוֹ וּבוֹעֲלָהּ בֵּינוֹ לְבֵין עַצְמוֹ וְתִהְיֶה לוֹ לְאִשָּׁה. כֵּיוָן שֶׁנִּתְּנָה תּוֹרָה נִצְטַוּוּ יִשְׂרָאֵל שֶׁאִם יִרְצֶה הָאִישׁ לִשָּׂא אִשָּׁה יִקְנֶה אוֹתָהּ תְּחִלָּה בִּפְנֵי עֵדִים וְאַחַר כָּךְ תִּהְיֶה לוֹ לְאִשָּׁה שֶׁנֶּאֱמַר (דברים כב יג) "כִּי יִקַּח אִישׁ אִשָּׁה וּבָא אֵלֶיהָ":
Before the giving of the Torah, it would be that if a man happened upon a woman in the marketplace and they wanted to marry each other, he would bring her into his house and consummate the marriage between them privately, and she would be his wife. Once the Torah was given, Israel was commanded that if a man wanted to marry a woman, he would acquire her first through witnesses, and afterwards she would be his wife, as it says, "When a man takes a woman and comes (sleeps with) to her..." (Deuteronomy 22:13).
What Halacha is the Rambam trying to teach us?
Please cite a source.