Deuteronomy 17:19
And it shall be with him, and he shall read therein all the days of his life: that he may learn to fear the LORD his God, to keep all the words of this law and these statutes, to do them: And it shall be with him, and he shall read therein all the days of his life: that he may learn to fear the LORD his God, to keep all the words of this law and these statutes, to do them:
When seated on the throne of his kingdom the king was to have a copy of the law written out from that kept before the priests the Levites, to keep it with him and to read in it all the days of his life. The continual reading was that he might learn to fear and reverence the Lord his God, and to keep and do all the words of the law and its statutes. This daily study was meant to keep his heart from being lifted up above his brethren and to keep him from turning aside from the commandment to the right hand or to the left, keeping him humble toward his fellow Israelites and steadfast in obedience. Obedience to what was written was the condition of prosperity in all he did, with the promise that keeping the law would prolong his days in his kingdom, he and his children in Israel, that they might continue long in the kingdom.
The requirement belongs to the law governing Israel's kingship and to a prophecy foretelling a monarchical form of government, in which God reserved to Himself the right to choose the king. The king was to rule as vicegerent, with God Himself recognized as head of the nation and His law enforced as the supreme law of the land. Rulers were subject to God's law and were only to enforce the laws God had given, having no authority to legislate for the nation, so that the monarchy continued the theocracy unchanged in principle. Israel's demand for a king like other nations departed from God's leadership, and an earthly king could become proud and unjust unless he trusted God and received wisdom from Him.
Solomon knew these warnings and instructions and for a time sought to live and rule by the statutes given at Sinai, and his conduct then stood in contrast to rulers who disregarded God's law. His later violations of God's commandments marked the beginning of his apostasy. Josiah resolved to follow this instruction given to Israel's rulers for obeying God's law, and his obedience made it possible for God to use him in a position of trust.
David placed the Word of God beside him on his throne and lived by its doctrines, and was then immovable. When he forsook its doctrines he sullied one of the fairest reputations. God's will for nations and individuals is to keep His wisdom beside them continually instead of setting it aside for the wisdom of man and for human inventions and devices. Wherever His will is violated by nations or by individuals a day of retribution comes, because turning from those who spread the Word leads people to make lies their refuge.