12 “Enter into His gates with confession”. At the gates is the beginning: begin with confession. Thence is the Psalm entitled, “A Psalm of Confession:” there be joyful. Confess that you were not made by yourselves, praise Him by whom you were made. Let your good come from Him, in departing from whom you have caused your evil. “Enter into His gates with confession.” Let the flock enter into the gates: let it not remain outside, a prey for wolves. And how is it to enter?
“With confession.” Let the gate, that is, the commencement for you, be confession. Whence it is said in another Psalm, “Begin unto the Lord with confession.” What he there calls “Begin,” here he calls “Gates.” “Enter into His gates in confession.” What? And when we have entered, shall we not still confess? Always confess Him: you have always what to confess for. It is hard in this life for a man to be so far changed, that no cause for censure be discoverable in him: you must needs blame yourself, lest He who shall condemn blame you.
Therefore even when you have entered His courts, then also confess. When will there be no longer confession of sins? In that rest, in that likeness to the Angels. But consider what I have said: there will there be no confession of sins. I said not, there will be no confession: for there will be confession of praise. You will ever confess, that He is God, thou a creature; that He is your Protector, yourself protected. In Him you shall be as it were hid. “Go into His courts with hymns; and confess unto Him.”
Confess in the gates; and when you have entered the courts, confess with hymns. Hymn are praises. Blame yourself, when you are entering; when you have entered, praise Him. “Open me the gates of righteousness,” he says in another Psalm, “that I may go into them, and confess unto the Lord.” Did he say, when I have entered, I will no longer confess? Even after his entrance, he will confess. For what sins did our Lord Jesus Christ confess, when He said, “I confess unto You, O Father”? He confessed in praising Him, not in accusing Himself. “Speak good of His Name.”
Source: The Enarrations, or Expositions, on the Psalms (New Advent)