A Commentary, Critical, Practical, and Explanatory on the Old and New Testaments, by Robert Jamieson, A.R. Fausset and David Brown  at sacred-texts.com
deu 17:1THINGS SACRIFICED MUST BE SOUND. (Deu 17:1)
Thou shalt not sacrifice . . . any bullock, or sheep, wherein is blemish--Under the name of bullock were comprehended bulls, cows, and calves; under that of sheep, rams, lambs, kids, he- and she-goats. An ox, from mutilation, was inadmissible. The qualifications required in animals destined for sacrifice are described (Exo 12:5; Lev 1:3).
deu 17:2IDOLATERS MUST BE SLAIN. (Deu 17:2-7)
If there be found among you . . . man or woman, that hath wrought wickedness--The grand object contemplated in choosing Israel was to preserve the knowledge and worship of the one true God; and hence idolatry of any kind, whether of the heavenly bodies or in some grosser form, is called "a transgression of His covenant." No rank or sex could palliate this crime. Every reported case, even a flying rumor of the perpetration of so heinous an offense, was to be judicially examined; and if proved by the testimony of competent witnesses, the offender was to be taken without the gates and stoned to death, the witnesses casting the first stone at him. The object of this special arrangement was partly to deter the witnesses from making a rash accusation by the prominent part they had to act as executioners, and partly to give a public assurance that the crime had met its due punishment.
deu 17:8THE PRIESTS AND JUDGES TO DETERMINE CONTROVERSIES. (Deu 17:8-13)
If there arise a matter too hard for thee in judgment--In all civil or criminal cases, where there was any doubt or difficulty in giving a decision, the local magistrates were to submit them by reference to the tribunal of the Sanhedrim--the supreme council, which was composed partly of civil and partly of ecclesiastical persons. "The priests and Levites," should rather be "the priests--the Levites"; that is, the Levitical priests, including the high priest, who were members of the legislative assembly; and who, as forming one body, are called "the judge." Their sittings were held in the neighborhood of the sanctuary because in great emergencies the high priest had to consult God by Urim (Num 27:21). From their judgment there was no appeal; and if a person were so perverse and refractory as to refuse obedience to their sentences, his conduct, as inconsistent with the maintenance of order and good government, was then to be regarded and punished as a capital crime.
deu 17:14THE ELECTION AND DUTY OF A KING. (Deu 17:14-20)
When thou . . . shalt say, I will set a king over me--In the following passage Moses prophetically announces a revolution which should occur at a later period in the national history of Israel. No sanction or recommendation was indicated; on the contrary, when the popular clamor had effected that constitutional change on the theocracy by the appointment of a king, the divine disapproval was expressed in the most unequivocal terms (Sa1 8:7). Permission at length was granted, God reserving to Himself the nomination of the family and the person who should be elevated to the regal dignity (Sa1 9:15; Sa1 10:24; Sa1 16:12; Ch1 28:4). In short, Moses foreseeing that his ignorant and fickle countrymen, insensible to their advantages as a peculiar people, would soon wish to change their constitution and be like other nations, provides to a certain extent for such an emergency and lays down the principles on which a king in Israel must act. He was to possess certain indispensable requisites. He was to be an Israelite, of the same race and religion, to preserve the purity of the established worship, as well as be a type of Christ, a spiritual king, one of their brethren.
deu 17:15thou mayest not set a stranger over thee, which is not thy brother--that is, by their free and voluntary choice. But God, in the retributions of His providence, did allow foreign princes to usurp the dominion (Jer 38:17; Mat 22:17).
deu 17:16he shall not multiply horses to himself--The use of these animals was not absolutely prohibited, nor is there any reason to conclude that they might not be employed as part of the state equipage. But the multiplication of horses would inevitably lead to many evils, to increased intercourse with foreign nations, especially with Egypt, to the importation of an animal to which the character of the country was not suited, to the establishment of an Oriental military despotism, to proud and pompous parade in peace, to a dependence upon Egypt in time of war, and a consequent withdrawal of trust and confidence in God. (Sa2 8:4; Kg1 10:26; Ch2 1:16; Ch2 9:28; Isa 31:3).
deu 17:17Neither shall he multiply wives to himself, that his heart turn not away--There were the strongest reasons for recording an express prohibition on this point, founded on the practice of neighboring countries in which polygamy prevailed, and whose kings had numerous harems; besides, the monarch of Israel was to be absolutely independent of the people and had nothing but the divine law to restrain his passions. The mischievous effects resulting from the breach of this condition were exemplified in the history of Solomon and other princes, who, by trampling on the restrictive law, corrupted themselves as well as the nation.
neither shall he greatly multiply . . . silver and gold--that is, the kings were forbidden to accumulate money for private purposes.
deu 17:18he shall write him a copy of this law in a book--The original scroll of the ancient Scriptures was deposited in the sanctuary under the strict custody of the priests (see on Deu 31:26; Kg2 22:8). Each monarch, on his accession, was to be furnished with a true and faithful copy, which he was to keep constantly beside him, and daily peruse it, that his character and sentiments being cast into its sanctifying mould, he might discharge his royal functions in the spirit of faith and piety, of humility and a love or righteousness.
deu 17:20that he may prolong his days in his kingdom, he and his children--From this it appears that the crown in Israel was to be hereditary, unless forfeited by personal crime.