פִּתְחוּ־לִ֥י שַׁעֲרֵי־צֶ֑דֶק אָֽבֹא־בָ֝ם אוֹדֶ֥ה יָֽהּ׃
請為我敞開公義的門;我要進去,稱謝永恆者。
Rashi
Open for me the gates of righteousness And these are the gates of righteousness.
Ibn Ezra
He who was rescued, he is obligated to thank Him. This is righteousness.
Malbim
Open (the king and the upright ones who went with him arrived at the Temple to give thanks and to bring their offerings of thanksgiving and sacrifice that day), and this [opening] is a mitzvah for the gatekeepers that they should open the gates of justice for him these are the gates of the Temple so that he may enter and thank H' He called them the gates of justice because after his salvation came by means of chastisements, H' treated him in accordance with the attribute of justice according to his actions, and not in accordance with the attribute of kindness.