On two separate occasions, perhaps separated by at least three years, Jesus cast out the money changers and merchants from the temple precinct. The first account, early in His ministry, is recorded in John 2:13-17. The second cleansing took place during the final week of His earthly ministry on Monday (Matthew 21:12-16; Mark 11:15-18; Luke 19:45-47).
Then Jesus entered the temple area and drove out all those who were selling and buying in the temple courts, and turned over the tables of the money changers and the chairs of those selling doves. And he said to them, “It is written, ‘My house will be called a house of prayer,’ but you are turning it into a den of robbers!” (Matthew 21:12-13 NET)
The photo below shows the Temple as it is envisioned from the time of Jesus. This wonderful model was displayed for many years on the grounds of the Holyland Hotel, but is now displayed at the Israel Museum in Jerusalem. Money changing and selling of sacrificial animals was an appropriate function. Then why did Jesus react as He did? The merchants were in the wrong place. They were in the temple precinct (hieros), the large area surrounding the temple proper (the sanctuary where the priests were allowed; naos).