Deuteronomy 17:20

20 He must not become proud and arrogant, changing the commands at whim to suit himself or making up his own versions. If he reads and learns, he will have a long reign as king in Israel, he and his sons.

Deuteronomy 17:20 Meaning and Commentary

Deuteronomy 17:20

That his heart be not lifted up above his brethren
On account of his office, the dignity of it, considering that he was subject to the law of God, and accountable to the Lord for all his actions:

and that he turn not aside from the commandment, to the right hand or
to the left;
not in the least deviate from the law of God in the whole of his conduct, and particularly in the exercise of his kingly office:

to the end that he may prolong his days in his kingdom;
ruling well according to the laws of God being the way to rule long:

he and his children in the midst of Israel;
this shows, as Jarchi observes, that if his son was fit for the kingdom, he was to be preferred to any other man; for though it was elective, yet to be continued in the same family, provided they walked in the ways of the Lord, and observed his laws.

Deuteronomy 17:20 In-Context

18 This is what must be done: When he sits down on the throne of his kingdom, the first thing he must do is make himself a copy of this Revelation on a scroll, copied under the supervision of the Levitical priests.
19 That scroll is to remain at his side at all times; he is to study it every day so that he may learn what it means to fear his God, living in reverent obedience before these rules and regulations by following them.
20 He must not become proud and arrogant, changing the commands at whim to suit himself or making up his own versions. If he reads and learns, he will have a long reign as king in Israel, he and his sons.
Published by permission. Originally published by NavPress in English as THE MESSAGE: The Bible in Contemporary Language copyright 2002 by Eugene Peterson. All rights reserved.