The event described in John 2:13-22 is separate from the event described in the Synoptics. John Chrysostom (4th c.) comments here:
Another Evangelist writes, that as He cast them out, He said, Make not my Father’s house “a den of thieves,” but this one, “Make not My Father’s house) an house of merchandise.”
They do not in this contradict each other, but show that he did this a second time, and that both these expressions were not used on the same occasion, but that He acted thus once at the beginning of His ministry, and again when He had come to the very time of His Passion. Therefore, (on the latter occasion,) employing more strong expressions, He spoke of it as(being made) “a den of thieves,” but here at the commencement of His miracles He does not so, but uses a more gentle rebuke; from
which it is probable that this took place a second time.1
Origen (2d/3d c.) made a similar observation:
It is to be noted that John makes this transaction of Jesus with those He found selling oxen and sheep and doves in the temple His second work; while the other Evangelists narrate a similar incident almost at the end and in connection with the story of the passion ... After giving an account nearly identical with this, as far as, “And Jesus went up to Jerusalem, and He found in the temple those who were selling oxen and sheep,” [John] gives a second account of an ascent of the Lord to Jerusalem, and then goes on to tell of the supper in Bethany six days before the passover, at which Martha served and Lazarus was at table ... Three of the Gospels place these incidents, which we supposed to be the same as those narrated by John, in connection with one visit of the Lord to Jerusalem. While John, on the other hand, places them in connection with two visits which are widely separated from each other and between which were various journeys of the Lord to other places. I conceive it to be impossible for those who admit nothing more than the history in their interpretation to show that these discrepant statements are in harmony with each other. If any one considers that we have not given a sound exposition, let him write a reasoned rejoinder to this declaration of ours.2
The later Byzantine commentator Theophylact of Ohrid comments:
Twice the Lord drove out the money changers: when He began working miracles, as described here; and shortly before His passion, as recorded by Matthew. Here the Lord speaks more gently. Make not My Father's house a house of merchandise. Because this was the beginning of His miracles, He does not speak with such boldness as He would employ later, after displaying His power on many occasions. Then He would say, as Matthew relates, "Do not make it a den of thieves"3, accusing them of thievery, since they made their profit by unrighteous means.4
1. Homily XXIII on John
2. Commentary on the Gospels, X.15, "Discrepancy on the Gospel Narratives Connected with the Cleansing of the Temple"
3. Matthew 21:13
4. Explanation of the Holy Gospel According to St. John (tr. from the Greek; Chrysostom Press, 2007), p.44