Parshat Shoftim discusses a principle that is known in the modern legal system as the separation of powers. The Israelite society was to be built upon four governing institutions, each with partial authorities, and their main titles are: King, Judge, Priest, and Prophet. It is understood that these institutions take different forms throughout generations. The king is not always a king; sometimes it can be a parliamentary democracy. It can be a parliament or any governing body, but it is just one part of the governance. The governance is divided among the king, the judge, the priest, and the prophet.
The question arises: What is the most desirable form of governance? Does the Torah favor a king, or does it not favor a king? To this, the Torah says, "Appoint over you a king like all the nations around you." It appears to instruct that, only then shall you appoint a king over the Israelite Nation. This means that as the political culture evolves and we see that states governed by a king are more organized than states without a king, then we know that the time has come to appoint a king over ourselves- like all the nations around us.
And here arises a question: How is it possible that something as central as the form of governance is dependent on the political culture of the nations of the world at that time? The answer is very simple. The very reason that God demanded His people to establish a state and not suffice with the establishment of a cosmopolitan or universal religion is to influence the nations of the world. The central fulcrum that moves matters in this world is the political tool. Therefore, the Torah demanded that Israel establish a political entity, a state. And the purpose of this state is to influence the nations of the world through their states. And one cannot influence the influenced if there is no minimal resemblance between the influencer and the influenced.
This is the reason that the Torah demanded that when we establish a political entity, so that we too be able to influence through the political culture of the world.