The book of Deuteronomy proposes a theocratic social order as optimal for the people of God. It allows secular, in particular royal, power, yet Deuteronomy noticeably limits the king's rights. The point is not that from the point of view of the Torah precisely hierocracy, the rule of the priesthood, is the only possible form of social order for the people of God: the legislation of Exodus, for example, does not insist on hierocracy.
The book of Deuteronomy was written quite late, perhaps around the middle of the ninth century BC, when traditionalism with its religious order had gone into the past forever, and society, particularly in the Kingdom of Israel where the book was written, was essentially pagan. The leaders of the prophetic movement of this era were sure that only strict centralization of worship and the authority of the priesthood could in such conditions protect the people from paganism. Their views found expression in Deuteronomy.
But besides this strictly historical aspect, there is in it something universal, independent of any historical specifics. Supreme judicial authority is entrusted to the temple priesthood not only because it, and also the prophetic communities, alone were in those days the guardians of pure Yahwism, without any pagan influences or additions.
It is entrusted to them first of all because the temple priesthood in the era of the First Temple was the bearer of a more or less generally accepted value system. Judicial procedure is impossible without such a generally accepted value system, just as any legislation is impossible without it: a society whose value norms do not coincide with the laws in force cannot be forced to observe those laws.
Values, in turn, require an absolute spiritual foundation, an absolute source. No human community and no institution created by people can be such an absolute source: only God can put every dot on every i when it comes to spiritual and moral values. It is not accidental that the history of the Torah at Sinai begins with its being given to Moses as a prophet of God.
In the age of Moses, Joshua, and the Judges, God's people were the chief interpreters of this God-given Torah, and the people, seeing them as people of God, listened to their words. In the era of the First Temple the people likewise listened to the words of the Levitical priests.
It is not surprising that Deuteronomy, in new and changed conditions, entrusts the highest judicial authority to them: now they become the interpreters of the Torah. But the system of spiritual and moral values remains the same. And the logic of the Torah as active legislation also remains the same: the expression and embodiment in law of this system of values, so that the Torah may become an instrument for organizing the life not only of an individual person, but also of a whole people in its social and state life.