I think that the information about the Temple of Jerusalem and the activities connected with the Temple worship will help us to situate and understand the narrative of Jesus cleansing the Temple of Jerusalem.
The Temple of Jerusalem was considered the most sacred and the most important institution of Israel. The magnificence of the Temple, its feasts and the numberless pilgrims it attracted point to the position the Temple came to occupy in Jewish religion. It was not only the religious centre of the nation but also its economic and even political centre. Financial transactions, such as loans, transfers of funds, deposits of money, etc., could be made by the Temple authorities. Those who had control over the management of the Temple wielded great political influence. As guardians of the Temple they controlled the political life of Israel as a nation to a very great extent. The Jews spared no pains to defend this all important symbol of national identity. I think this was their last standing symbol as a nation because Israel for a major part of their history was under some foreign rule. This is reflected by Israel’s strong belonging to the Temple of Jerusalem from a very ancient time.
The Temple collected annual taxes from every adult male. The tax had to be paid in non-Gentile coins. It was therefore necessary to exchange the Roman coins, which were in common use, with ancient Palestinian or Tyrian currency to pay the Temple tax, hence the presence of money changers who had their tables in the court of the Gentiles.
Pilgrims, as a rule, offered animals and other items for sacrifice in the Temple. For this purpose there were four markets in the vicinity of the Temple on the Mount of Olives. However, towards 30 CE, Caiaphas, the high priest opened markets within the precincts of the Temple in competition with the markets outside. Thus the sale of animals, birds, and other items for sacrifice began in the court of the Gentiles.