שֶׁיִּכְתֹּב הַמֶּלֶךְ סֵפֶר תּוֹרָה שֵׁנִי לְעַצְמוֹ – שֶׁמִּצְוָה עַל הַמֶּלֶךְ שֶׁיִּהְיֶה עַל יִשְׂרָאֵל, לִכְתֹּב סֵפֶר תּוֹרָה מְיֻחָד לוֹ מִצַּד הַמְּלוּכָה, שֶׁתִּהְיֶה עִמּוֹ תָּמִיד וְיִקְרָא בּוֹ, מִלְּבַד סֵפֶר תּוֹרָה אַחֵר שֶׁמִּצְוָה עָלָיו לִכְתֹּב כְּכָל אֶחָד מִיִּשְׂרָאֵל, כְּמוֹ שֶׁנִּכְתֹּב בַּמִּצְוָה הָאַחֲרוֹנָה שֶׁבַּסֵּפֶר בְּעֶזְרַת הַשֵּׁם (מצוה תריג). וְעַל זֶה נֶאֱמַר (דברים יז יח) וְכָתַב לוֹ אֶת מִשְׁנֵה הַתּוֹרָה הַזֹּאת וְגוֹ'. That the king write a second Torah scroll for himself: That it is a commandment on the king that will be over Israel to write for himself a specific scroll of the Torah, from the angle of [his being king], that it be with him always and [from] which he read — besides the other Torah scroll which is a commandment for him, like every one of Israel, to write, as we will write in the last commandment of the book, with God’s help (Sefer HaChinukh 613). And about this is it stated (Deuteronomy 17:18), “and he shall write for himself a copy of this Torah, etc.”
מִשָּׁרְשֵׁי הַמִּצְוָה. לְפִי שֶׁהַמֶּלֶךְ בִּרְשׁוּת עַצְמוֹ לֹא יַעֲצִיבֵהוּ אָדָם עַל מַעֲשָׂיו וְלֹא יִגְעַר בּוֹ, וּבְשֵׁבֶט פִּיו יַכֶּה אַרְצוֹ וּבְרוּחַ שְׂפָתָיו יָמִית מִי שֶׁיִּרְצֶה בְּכָל עַמּוֹ, עַל כֵּן בֶּאֱמֶת צָרִיךְ שְׁמִירָה גְּדוֹלָה וְזִכָּרוֹן טוֹב יַעֲמֹד נֶגְדּוֹ, יַבִּיט אֵלָיו תָּמִיד לְמַעַן יִכְבֹּשׁ אֶת יִצְרוֹ וְיַטֶּה לִבּוֹ אֶל יוֹצְרוֹ, וְזֶהוּ שֶׁאָמְרוּ זִכְרוֹנָם לִבְרָכָה (סנהדרין כא, ב) יוֹצֵא לְמִלְחָמָה וְסֵפֶר תּוֹרָה עִמּוֹ, יוֹשֵׁב בַּדִּין וְהוּא עִמּוֹ, מֵסֵב לֶאֱכֹל וְהוּא כְּנֶגְדּוֹ. כְּלָל הַדְּבָרִים, שֶׁלֹּא הָיָה זָז מִנֶּגֶד עֵינָיו אֶלָּא בְּעֵת שֶׁהוּא נִצְרַךְ לִנְקָבָיו אוֹ נִכְנָס לַמֶּרְחָץ. It is from the roots of the commandment [that it is] because the king is under his own power — no man will pain him over his actions nor rebuke him, and with the staff of his mouth he can plague his land and with the breath of his lips he can kill anyone he wants from his entire people. Therefore he truly needs great guarding, and a proper reminder standing in front of him [so that] he will always look upon it in order to conquer his impulse and turn his heart towards his Creator. And this is [the meaning of] that which they, may their memory be blessed, said (Sanhedrin 21b), “When he goes out to war, the Torah scroll is with him; sitting in judgment, it is with him; adjourns to eat, it is in front of him.” The general rule of the matter is that it not move from in front of his eyes except when he needs to [relieve himself] or enters the bathhouse.
מִדִּינֵי הַמִּצְוָה. מָה שֶׁאָמְרוּ זִכְרוֹנָם לִבְרָכָה (ירושלמי סנהדרין פ"ב ה"ו) שֶׁסֵּפֶר תּוֹרָה שֶׁל מֶלֶךְ מִצְוָה עָלָיו לְהַגִּיהוֹ מִסֵּפֶר הָעֲזָרָה עַל פִּי בֵּית דִּין, כְּדֵי שֶׁיְּכַוֵּן עַל פִּי מַעֲשָׂיו בְּיֹשֶׁר. וְיֶתֶר פְּרָטֵי דִּינֵי סֵפֶר תּוֹרָה, אֶכְתֹּב אוֹתָם בְּעֶזְרַת הַשֵּׁם בַּמִּצְוָה אַחֲרוֹנָה שֶׁבַּסֵּפֶר. וְזֹאת אַחַת מִן הַמִּצְוֹת שֶׁאָמַרְנוּ בִּתְחִלַּת הַסֵּפֶר, שֶׁהֵם מֻטָּלוֹת עַל הַמֶּלֶךְ לְבַד. וְאֵין צֹרֶךְ לִכְתֹּב בָּהּ בְּאֵיזֶה זְמַן הִיא נוֹהֶגֶת, שֶׁיָּדוּעַ הַדָּבָר שֶׁאֵין מַלְכוּת בְּיִשְׂרָאֵל אֶלָּא בִּזְמַן שֶׁאַרְצָם בְּיִשּׁוּבָהּ, תֶּחֱזֶינָה עֵינֵינוּ בִּמְהֵרָה בְּבִיאַת הַגּוֹאֵל, וּמָלַךְ עָלֵינוּ בְּתוֹכָהּ. From the laws of the commandment is that which they, may their memory be blessed, said (Talmud Yerushalmi Sanhedrin 2:6) that it is a commandment to check the Torah scroll of the king from the scroll in the [Temple] yard by word of the court, so that he arrange all of his deeds with righteousness. And I will write the rest of the details of the laws of a Torah scroll, with God’s help, in the last commandment of the book. And this is one of the commandments that we said at the beginning of the book which is only incumbent upon the king. And there is no need to write at which time it is practiced, as the thing is well-known that there is no monarchy in Israel except at the time that their Land is in its inhabitation — may our eyes see it soon with the coming of the redeemer, and he shall rule over us in it.