(18) You shall appoint magistrates and officials for your tribes, in all the settlements that Adonai your God is giving you, and they shall govern the people with due justice. (19) You shall not judge unfairly: you shall show no partiality; you shall not take bribes, for bribes blind the eyes of the discerning and upset the plea of the just. (20) Justice, justice shall you pursue, that you may thrive and occupy the land that Adonai your God is giving you.
(2) למען תחיה וירשת That you may thrive and occupy the land — The appointment of proper judges is sufficient to make Israel thrive and to establish them on their land.
How does Rashi (11th century France) understand Tzedek Tzedek Tirdof?
(1) Justice, justice — This is addressed to each of the contending parties. The repetition of "justice" implies that they should pursue a just result whether it brings them profit or loss, or perhaps that they should continue to pursue justice time after time, as long as they live. Or it may simply be for emphasis.
How does Ibn Ezra (12th century Spain) understand Tzedek Tzedek Tirdof?
Justice, justice... The great Mussar rabbis say that if one hastens to give tzedakah it is worth double, as if one gave tzedakah twice. Tzedek tzedek - it will be considered as two tzedakahs, if "you pursue" it, if you try to give it as soon as possible.
Hida (18th century Palestine & Western Europe, North Africa)
Justice, justice you shall pursue...With justice, you shall pursue justice. Even the pursuit of justice must employ only just means, and not falsehood.
R' Simhah Bunim of Pshischa (18th century Polan)
Justice, justice you shall pursue...Justice alone is not enough, because there are many types of justice, just as there are many kinds of truth. Every regime has its own justice. The Torah, therefore, stresses, "Justice justice you shall pursue," namely the musar (ethic) of justice, where both the means and the end are just.
Derashot El Ami (19th-20th century Poland & Palestine)