You do realize that there were multiple courtyards in the Temple grounds, right? One of these was setup for the sale of sacrifices and had been set up that way since the Temple had been rebuilt.
Actually there were 4 courts outside of the temple ... yes I am aware of them ... and they were outside of the temple itself. And the temple structure had chambers that also were not considered part of the actual temple either.
People can do their own research on this ... but briefly...
Josephus, in describing the Herodian Temple of his own day (War V, 220-221) mentions the chambers surrounding the Temple. They had three stories and doors connecting them. He also indicates that these chambers did not surround the upper story of the Temple, which in his view was 40 cubits high. Again, in this account as well, he does not seem to allude to the outward slant of the chambers.
These same structures appear in the Temple plan of the Temple Scroll. Effectively, these structures were part of the same building as housed the Temple. However, since they were entered from the outside they were not considered to be part of the actual Temple.
all the verses I find say He entered the temple ... (doesn't say he entered the courtyard(s) of the temple)
Matthew 21:12-13
12 And Jesus
entered the temple and drove out all those who were buying and selling
in the temple, and overturned the tables of the money changers and the seats of those who were selling doves.
13 And He said to them, “It is written, ‘MY HOUSE SHALL BE CALLED A HOUSE OF PRAYER’; but you are making it a ROBBERS’ DEN.”
Mark 11:15-18
15 Then they came to Jerusalem. And He entered the temple and began to drive out those who were buying and selling
in the temple, and overturned the tables of the money changers and the seats of those who were selling doves;
16 and He would not permit anyone to carry merchandise
through the temple.
17 And He began to teach and say to them, “Is it not written, ‘ MY HOUSE SHALL BE CALLED A HOUSE OF PRAYER FOR ALL THE NATIONS’? But you have made it a ROBBERS’ DEN.”
and yes another thing he took issue with was corruption of their business practices (den of thieves) ... and yes that does happen today ... but people choose how to run their business(s) ... either honestly or not .... and they are responsible for that ... it's not the capitalistic system that controls this .... it's THE PEOPLE running the businesses.
Any government system put in place will be corrupt because mankind is corrupt.