There is no simple answer to your question because there is more than one reason for Jesus' actions.
To identify the main motivation of the Messiah, we have to compare your quote from Matthew with the parallel text in the Gospel of Mark 11:
15 On reaching Jerusalem, Jesus entered the temple courts and began
driving out those who were buying and selling there. He overturned the
tables of the money changers and the benches of those selling doves,
16 and would not allow anyone to carry merchandise through the temple
courts. 17 And as he taught them, he said,“Is it not written: ‘My
house will be called a house of prayer for all nations’? But you have
made it ‘a den of robbers.’”
Aha, the temple was designed to be a house of prayer for all nations. Jesus quotes here from Isaiah 56:
1 This is what the Lord says: “Maintain justice and do what is right,
for my salvation is close at hand and my righteousness will soon be
revealed. 2 Blessed is the one who does this— the person who holds it
fast, who keeps the Sabbath without desecrating it, and keeps their
hands from doing any evil.” 3 Let no foreigner who is bound to the
Lord say, “The Lord will surely exclude me from his people.” And let
no eunuch complain, “I am only a dry tree.” 4 For this is what the
Lord says: “To the eunuchs who keep my Sabbaths, who choose what
pleases me and hold fast to my covenant— 5 to them I will give within
my temple and its walls a memorial and a name better than sons and
daughters; I will give them an everlasting name that will endure
forever. 6 And foreigners who bind (join) themselves to the Lord to
minister to him, to love the name of the Lord, and to be his servants,
all who keep the Sabbath without desecrating it and who hold fast to
my covenant— 7 these I will bring to my holy mountain and give them
joy in my house of prayer. Their burnt offerings and sacrifices will
be accepted on my altar; for my house will be called a house of prayer
for all nations.” 8 The Sovereign Lord declares— he who gathers the
exiles of Israel: “I will gather still others to them besides those
already gathered.”
Isaiah prophesied here about the time in the future when the temple of JHVH will be for all nations. On top of that, a eunuch would become a member of Israel, and a foreigner would become a priest. Keep in mind that according to the law of Moses, a eunuch couldn't become an Israelite due to the fact that he was missing the body part necessary to be circumcised during the act of conversion, Deuteronomy 23:
1 No one who has been emasculated by crushing or cutting may enter the
assembly of the Lord.
Likewise only the Levites from the clan of Aaron were allowed to become priest. The verse ”foreigners who bind (join) themselves” is a word play of the name of Levi, the third son of Jacob, Genesis 29:34:
And she conceived again and bore a son and said, “Now this time my husband will be joined to me because I have borne him three sons.” Therefore he was named Levi.
It would be impossible to become a priest for anyone else than the descendant of Aaron under the law of Moses.
Jesus, quoting from Isaiah, declares that the fulfillment of the prophecy is near. Remember also that Christ is the true temple, and the structure built by Solomon in Jerusalem was a shadow and a physical picture of a spiritual reality (John 2:21).
If you look at the plans of the Herod's temple, there is only one area that could be used as a market. It had to be the outer courts, known as the courtyards of the gentiles. The only place where gentiles were allowed to enter had been transformed into a noisy and smelly marketplace full of animals. How could one pray in a place like this? I am convinced that this was the number one reason for Jesus' anger.
https://www.catholicweekly.com.au/wp-content/uploads/2020/06/Herod_Great_Temple_POST.jpg
The second scripture from which Jesus was quoting was Jeremiah 7. The famous sermon against the authorities ruling the first temple, Jerusalem, and the whole kingdom of Judah. You should see both scenes in the same light, with the same kind of accusations.
The robbers feel safe in their dens, protected from justice and punishment. The authorities of the time of Jeremiah were using the temple in the same way. As a cover and justification for their own sins and corruption. As long as we have the temple of the LORD, we are safe, and He will forgive us for all our misconduct, they thought. They were obviously wrong and misjudged God's character. When the Babylonians came, the divine protection was lifted, and they were allowed to destroy the place.
The priests and authorities of Jesus' times were making exactly the same mistake. So the cleansing of the temple could be interpreted as the same type of warning as Jeremiah's sermon. But we know that the new rulers had learned nothing from the past events.
As a rule of a thumb, a quoted verse from the OT usually hyperlinks to a larger section of a text rather than the exact quote. So casting out the money changers together with the sellers and their animals links to the last section of Jeremiah 7:
21 “ ‘This is what the Lord Almighty, the God of Israel, says: Go
ahead, add your burnt offerings to your other sacrifices and eat the
meat yourselves! 22 For when I brought your ancestors out of Egypt and
spoke to them, I did not just give them commands about burnt offerings
and sacrifices, 23 but I gave them this command: Obey me, and I will
be your God and you will be my people. Walk in obedience to all I
command you, that it may go well with you. 24 But they did not listen
or pay attention; instead, they followed the stubborn inclinations of
their evil hearts. They went backward and not forward. 25 From the
time your ancestors left Egypt until now, day after day, again and
again I sent you my servants the prophets. 26 But they did not listen
to me or pay attention. They were stiff-necked and did more evil than
their ancestors.’
Jesus reminded the priests who were in control of the sacrifices and the market in the temple that God has no pleasure in them. His desire is the obedience of his people, not the blood of the animals.
The last but not least is the issue of the money. The official currency used in the temple at that time was a pagan Tyrian shekel. It bore the image of pagan deities but was accepted because of its purity and the right weight of silver.
"The shekel, with the laureate head of Melqarth-Herakles (a pagan
deity) on the obverse and an eagle (a graven image) on the reverse,
averaged 14.2 gm in weight and contained at least 94 per cent silver.
These coins were minted in Tyre between 126/125 BC and 19/18 BC. After
the Roman government closed the Tyre mint, these coins continued to be
minted at an unknown mint, probably in or near Jerusalem, from 18/17
BC until AD 69/70. The Jewish coin makers continued to strike coins
with the image of Melqarth-Herakles and the eagle. This was contrary
to the clear teachings of the Word of God (Ex 20:3, 4: Dt. 4:16-18;
5:8). Yet the rabbis declared that the Tyrian shekels were the only
legal currency that was acceptable in the Temple (Hendin 2001:420-29;
2002:46, 47). The rabbis decided that the commandment to give the
half-shekel Temple tax, with its proper weight and purity, was more
important than the prohibition of who or what image was on the coin."
https://biblearchaeology.org/research/divided-kingdom/3646-the-tyrian-shekel-and-the-temple-of-jerusalem
"Melqart was possibly the Ba‘al found in the Tanakh (the Jewish Bible,
specifically in 1 Kings 16.31–10.26) whose worship was prominently
introduced to Israel by King Ahab and largely eradicated by King
Jehu." https://en.wikipedia.org/wiki/Melqart