This story is known as the cleansing of the temple. Not all interpreters of this passage share the view that it is a cleansing. The main interpretations of this act are:
a) Jesus cleans the temple from traders, who misuse the temple for business;
b) the traders were in the court of the Gentiles, but how can they pray surrounded by all the noise of sellers and buyers? Jesus frees this court for prayer by Gentiles;
c) the temple had become a centre of Jewish nationalism against Gentiles, so Jesus makes the temple a house of prayer for the Gentiles (a prophesy of mission among the nations);
d) Jesus makes clear: the temple worship will end; he will make it redundant (superfluous) by his sacrifice on the cross, the curtain in the temple will be torn in two (Mark 15:38);
e) Jesus condemns the use of the temple by the leaders who are hypocrites, God’s judgment will come.
These interpretations do not exclude each other. Jesus explains his act in Mark 11:17.
His act is possibly a protest against lack of prayer, or materialism, or nationalism, but the main reason is: the time of the Messiah has come, while a big part of Israel (including the leaders in the temple) rejects the Messiah. That is why judgment will come. Jesus stops the temple business temporally as a sign that it will stop definitively when judgment comes.
15 And they came to Jerusalem. And he entered the temple and began to drive out those who sold and those who bought in the temple, and he overturned the tables of the money-changers and the seats of those who sold pigeons.