“And he shall write for himself a copy of this law!” (Devarim 17:18)
It is a positive commandment which is incumbent on a king that he should write a Torah Scroll set aside for him because of his kingship, which will be constantly with him and he should read in it. This is apart from the Torah Scroll which he is obligated to write like all of the other members of Klal Yisrael, as we will explain in the final commandment (with the help of Hashem). About this the Torah says “And he shall write for himself a copy of this law!”.
Amongst the roots of this commandment are the fact that the king is solely responsible for his own actions, no other man may rebuke him for his deeds, with the staff of his mouth he may rule his land and with the wind of his lips he may kill whomsoever he wishes from his people. It follows that he needs extra guarding, and he needs a good reminder opposite him, which he looks at constantly to be able to overcome his evil inclination and to bend his heart towards his Creator. This is the explanation of that which Chazal said that the king goes out to war and takes a Torah Scroll with him, he sits in judgment and keeps the Torah Scroll with him and he lies down to eat and the Torah Scroll stays with him. The rule is, that the Torah Scroll may not be out of his sight unless he needs to be excused or he goes wash himself.
Amongst the laws of this commandment are that the king must correct his Torah Scroll from the Torah Scroll which is kept in the courtyard of the Temple for the Beis Din, so that he will be able to correctly work out the right way to behave.
This is one of those commandments which are incumbent only on the king. It is unnecessary to explain when this commandment applies, as everyone knows that Klal Yisrael only have a king when the land is inhabited by our nation. May our eyes see speedily the coming of the redeemer, so that he will rule over us in it.