The Sefer HaChinukh explains the commandment and meaning of the laws of a woman after childbirth, emphasizing the moral and ritual purposes behind the Torah's timing. It provides a mitzvah-oriented explanation of the postpartum laws.
וּכְבָר אָמַרְנוּ בְּאַזְהָרַת טְרֵפָה (מצוה עג) וְאִסּוּרֵי מַאֲכָלוֹת (מצוה קמז קמח) כִּי הָאֵל בָּרוּךְ הוּא רִחֵק עַמּוֹ אֲשֶׁר בָּחַר מִכָּל הַדְּבָרִים הַמַּזִּיקִים אֶת הַגּוּף בַּעֲבוּר הֱיוֹתוֹ כְּלִי לַנֶּפֶשׁ הַיּוֹדַעַת יוֹצְרָהּ. וּכְמוֹ כֵן מִן הַשֹּׁרֶשׁ הַזֶּה הִרְחִיקָנוּ מִן הַיּוֹלֶדֶת וּמִן הַנִּדָּה וְהַזָּבָה יָמִים מִסְפָּר עַד שֶׁיִּתְנַקּוּ מֵאוֹתוֹ הַמּוֹתָר שֶׁבָּהֶן שֶׁהוּא דָּבָר רַע וּמַחְלִיא, וּכְמוֹ שֶׁאָמַרְנוּ כִּי כָּל מוֹתַר מִשֹּׁרֶשׁ מַחֲלָה הוּא. עַל כֵּן אָמְרוּ זִכְרוֹנָם לִבְרָכָה (רש"י ויקרא שם), שֶׁאֵין אִשָּׁה רוֹאָה דָם שֶׁלֹּא יְהוּ רֹאשָׁהּ וְאֵבָרֶיהָ כְּבֵדִים עָלֶיהָ, וְאֵין סָפֵק כִּי בְּאוֹתוֹ הַמּוֹתָר מַחֲלָה לָהֶן וּלְכָל הַקָּרֵב בָּהֶן שׁוּם קִרְבָה, וְכָל שֶׁכֵּן בְּתַשְׁמִישׁ הַמִּטָּה שֶׁהוּא תַּכְלִית הַקִּרְבָה הַחָמְרִית, וְגַם הַוָּלָד הַנּוֹלָד בְּעוֹד שֶׁאוֹתוֹ הַמּוֹתָר מִתְגַּבֵּר עָלֶיהָ מְעֻתָּד לָחֳלָאִים רָעִים. וּמִן הַשֹּׁרֶשׁ הַזֶּה שֶׁאָמַרְנוּ מִצַּד הַמּוֹתָר, צִוְּתָה הַתּוֹרָה לִהְיוֹת טְמֵאָה מִן הַזָּכָר שִׁבְעָה, וּמִן הַנְּקֵבָה שְׁבוּעַיִם, שֶׁאֵין סָפֵק כִּי מוֹתְרֵי הַיּוֹלֶדֶת נְקֵבָה גְּדוֹלִים מִן הַיּוֹלֶדֶת זָכָר, לְפִי שֶׁהֵרָיוֹן הַזָּכָר יוֹרֶה חֹם בַּנְּקֵבָה, וּכְמוֹ שֶׁאָמְרוּ זִכְרוֹנָם לִבְרָכָה (נדה כה ב) אִשָּׁה כִּי תַזְרִיעַ וְיָלְדָה זָכָר, אִשָּׁה מַזְרַעַת תְּחִלָּה יוֹלֶדֶת זָכָר, וְיָדוּעַ כִּי הַחֹם מוֹתָרָיו הֵם מְעַטִּים וִימַהֵר פְּעֻלָּתוֹ לְעוֹלָם, דָּבָר מֻשְׂכָּל הוּא, וְעַל כֵּן יַסְפִּיק לָנוּ בְּהֶרְיוֹן הַזָּכָר נִקָּיוֹן שֶׁל שִׁבְעָה יָמִים. וְעַל זֶה אָמְרוּ זִכְרוֹנָם לִבְרָכָה (נדה לה ב), כִּי מַעְיָן אֶחָד הוּא וְהַתּוֹרָה טִמְּאַתּוּ וְהַתּוֹרָה טִהֲרַתּוּ. כְּלוֹמַר שֶׁדְּמֵי הַלֵּדָה שֶׁטִּמְּאָה הַתּוֹרָה וּדְמֵי הַטֹּהַר שֶׁטִּהֲרָה הַתּוֹרָה מִמָּקוֹם אֶחָד הוּא וְהוּא מִן הַמָּקוֹר, שֶׁהוּא מָקוֹם טֻמְאָה יוֹצְאוֹת שְׁנֵיהֶן, אֶלָּא שֶׁהַתּוֹרָה תִּתְלֶה הָעִנְיָן בַּזְּמַן, וּתְטַמֵּא הַדָּם הַיֹּצֵא מִמֶּנָּה בִּזְמַן אֶחָד וּתְטַהֵר בַּזְּמַן הַשֵּׁנִי, וּבָרוּךְ הַיּוֹדֵעַ כָּל הַחָכְמָה כִּי הַכֹּל עָשָׂה בְּטַעַם נָכוֹן וּמְחֻיָּב, וְהוּא בָּרוּךְ הוּא יָדַע שֶׁעַד אוֹתוֹ הַזְּמַן, הַדָּמִים מַזִּיקִין וּמִשָּׁם וְאֵילָךְ לֹא יַזִּיקוּ. וְעַכְשָׁו נָהֲגוּ כָּל יִשְׂרָאֵל וְגָדְרוּ עַצְמָן לִנְהֹג טֻמְאָה בִּדְמֵי טֹהַר כְּמוֹ בִּדְמֵי טֻמְאָה. וּכְלַל הָעִנְיָן שֶׁאֵין הָאִשָּׁה עַכְשָׁו עוֹלָה מִטֻּמְאָתָהּ לְעוֹלָם עַד שֶׁתַּעֲמֹד שִׁבְעָה יָמִים שְׁלֵמִים נְקִיִּים מִכָּל דָּם וְתַתְחִיל לִמְנוֹתָן מִבָּעֶרֶב, זֶהוּ כְּלָל גָּדוֹל וְעַד הַיּוֹם נוֹהֲגִים כֵּן בְּכָל מְקוֹמוֹת יִשְׂרָאֵל הַכְּשֵׁרִים, וּבָזֶה נִצַּלְנוּ מִכַּמָּה סְפֵקוֹת. וְדִינֵי הַסְּפֵקוֹת הַמִּתְחַדְּשׁוֹת לִפְעָמִים עַל הַיּוֹלֶדֶת, כְּגוֹן אִם תִּתְחַיֵּב לֵשֵׁב עַל טֻמְאַת זָכָר אוֹ עַל טֻמְאַת נְקֵבָה, שֶׁפְּעָמִים תִּצְטָרֵךְ מִתּוֹךְ הַסָּפֵק לֵשֵׁב לְזָכָר וְלִנְקֵבָה וְגַם לְנִדָּה. וְדִין הַמַּפֶּלֶת כְּמִין בְּהֵמָה וְחַיָּה וָעוֹף מָה דִּינָהּ, וְאִם פָּנִים כִּפְנֵי אָדָם אוֹ אֵין פְּנֵיהֶם כִּפְנֵי אָדָם מָה דִּינָהּ וְהַמַּפֶּלֶת כְּמִין יַבְחוּשִׁין, כְּמִין שְׂעָרוֹת. וְהַמַּפֶּלֶת דְּמוּת אָדָם שֶׁיֵּשׁ לוֹ כְּנָפַיִם שֶׁל בָּשָׂר, וְכֵן הַמַּפֶּלֶת דְּמוּת אָדָם בְּעַיִן אַחַת וְיָרֵךְ אַחַת. וְהַמַּפֶּלֶת זָכָר וְסַנְדָּל עִמּוֹ, וְהִיא הַבְּרִיָּה שֶׁאֵינָהּ נִכֶּרֶת אִם זָכָר אוֹ נְקֵבָה. וְדִין הָאִשָּׁה שֶׁיּוֹצֵאת מְלֵאָה וּבָאָה רֵיקָנִית וְהִיא טוֹעָה בְּחֶשְׁבּוֹנָהּ. וְיֶתֶר רֻבֵּי פְּרָטֶיהָ בְּעִנְיְנֵי טֻמְאָתָהּ, הַכֹּל בְּמַסֶּכֶת נִדָּה (י"ד סי' קצ"א). וְעִנְיַן דִּינֵי קָרְבָּנוֹת, מְפֻזָּרִין בְּהַרְבֵּה מַסֶּכְתּוֹת. וּמֵהֶן הַרְבֵּה בִּזְבָחִים וַעֲרָכִין וּכְרֵיתוֹת וְקִנִּין וּנְגָעִים (י"ד ס' קכג).
And we have already said in the warning of the “torn” animal (Sefer HaChinukh 73) and in the prohibitions of foods (Sefer HaChinukh 147, 148) that God, blessed be He, distanced His people that He chose from all the things that hurt the body, in that it is a vessel for the soul that knows its Creator. And so too from this root did He distance us from the woman who has given birth, from the menstruant and from the zavah (a woman with an irregular discharge) for a few days, until they become cleansed from that excess that they have, which is a bad and infectious thing. Therefore they, may their memory be blessed, said (Rashi on Leviticus 12:2) that a woman never [experiences] blood unless her head and limbs are heavy upon her. And there is no doubt that this excess makes them, and anyone who comes close to them at all, sick. And all the more so with sexual relations, which is the epitome of physical closeness. And also the offspring that is born [from a union] while that excess overpowers her is destined for bad illnesses. And from this root that we said from the angle of excess, the Torah commanded that she be impure from the male seven [days] and two weeks from the female. As there is no doubt that the excesses of the woman that gives birth to a female are greater than one who gives birth to a male — since conception of a male indicates heat in the female. And [it is] like they, may their memory be blessed, said (Berakhot 60a), “‘If a woman conceives (literally, gives seed) and gives birth to a male — [if] a woman gives seed first, she gives birth to a male.” And it is well-known that the excesses of heat are few and its action is always quick — it is a logical thing. And therefore seven days of cleansing suffices with the pregnancy of a male. And about this they, may their memory be blessed, said (Niddah 35b) that there is one “wellspring” and the Torah made it impure, and the Torah [also] made it pure. [This is] meaning to say that the blood of birth that the Torah made impure and the blood of purification that the Torah made pure are from one place; and that is [that] both of them come out from the source (the uterus), which is a place of impurity. However the Torah made the matter depend on time and made impure the blood that comes from her at one time and made [it] pure at a second time. And blessed is the One that knows all wisdom, as He did every thing for a correct and necessary reason. And He, blessed be He, knows that up to a certain time, the blood is damaging; and [that] from then on, it is not damaging. But now all of Israel has girded itself and has become accustomed to treat the blood of purification like the blood of impurity. And the general principle of the matter is that a woman today does not ever emerge from her impurity until she undergoes seven full days clean from all blood. And she begins counting them from the evening. And this is a great principle and it is practiced until this day in all the places of the proper Israelites. And through this, we are saved from several doubts. And the laws of the doubts that sometimes arise upon the woman giving birth — for example, if she is obligated to sit [out] for the impurity of a male or the impurity of a female, as sometimes she must sit [out] for a male and a female and for [being] a menstruant from the doubt; the law of what is the law of one who has a miscarriage of a type of beast or bird; what is the law if their faces are like the faces of people or if their faces are not like the faces of people; what is the law of one who has a miscarriage of types of gnats [or] types of hairs; one who has a miscarriage of the image of a man that has wings of flesh; likewise one who has a miscarriage of the image of a man with one eye and one thigh; one who has a miscarriage of a male together with a sandal, and that is a creature that is not recognizable whether it is male or female; the law of a woman that goes out full and comes back empty and errs in her calculation — and the rest of its many details regarding her impurity are all in Tractate Niddah. (See Tur, Yoreh Deah 191.) And the matter of the laws of sacrifices are scattered in many tractates, and many of them are in Zevachim, Arakhin, Keritot and Negaim.