כצֶדֶק צֶדֶק תִּרְדֹּף לְמַעַן תִּחְיֶה וְיָרַשְׁתָּ אֶת הָאָרֶץ
My grandfather suggests a reason for the repetition of the word tzedek [justice]: the means, as well as the ends, have to be just. On should not compromise standard on the means in the name of a just end. He quotes Mishei 3:17: "Deracheyah darchei noam vechol nethivortheya shalom" with a gloss on nethivotheyha - its paths that bring one ultimately to pleasantness have to have the quality of shalom [peace].
My grandfatther cites the Mishna Peah 8:9 that quotes this verse: "If a person pretends to be blind or disabled in order to receive charity to which he is not entitled, he will ultimately become the thing he pretended to be, as per Deuteronomy 16:20, “Justice, justice you shall pursue.” He explains how it fits with his take on the means being held to a standard of justice, as well as the ends. The person who pretends a disability may deserve charity because he is lacking money. But he resorts to fraud to get it. So even if the ends are valid, the means are not, and that is what is disallowed under the injunction of the verse here.
Related post: http://kallahmagazine.blogspot.com/2015/10/dvar-yehudah-parsha-points-from-my.html