Mark 11:15-17 (RSV) 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; [16] and he would not allow any one to carry anything through the temple. [17] And he taught, and said 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 den of robbers.” 

Cambridge Bible for Schools and Colleges provides an answer as to why Jesus did this:

the tables of the moneychangers] The Greek word signifies those who took a small coin (Hebr. Kolbon, Grk. κόλλυβος, perhaps a Phœnician word) as a fee for exchanging the money of the worshippers, who were required to pay in Hebrew coin. This exaction of the fee was itself unlawful (Lightfoot). And probably other dishonest practices were rife.

Encyclopedia Judaica (“Money Changers”) confirms that this interest-taking was contrary to Jewish Law:

In the period of the Second Temple vast numbers of Jews streamed to Palestine and Jerusalem “out or every nation under heaven” (Acts 2:5), taking with them considerable sums of money in foreign currencies. This is referred to in the famous instance of Jesus’ driving the money changers out of the Temple (Matt. 21:12). Not only did these foreign coins have to be changed but also ordinary deposits were often handed over to the Temple authorities for safe deposit in the Temple treasury (Jos., Wars 6:281–2). Thus Jerusalem became a sort of central bourse and exchange mart, and the Temple vaults served as “safe deposits” in which every type of coin was represented (TJ, Ma’as. Sh. 1:2, 52d, and parallels). The business of money exchange was carried out by the shulḥani (“exchange banker”), who would change foreign coins into local currency and vice versa (Tosef., Shek. 2:13; Matt. 21:12). People coming from distant countries would bring their money in large denominations rather than in cumbersome small coins. The provision of small change was a further function of the shulḥani (cf. Sif. Deut., 306; Ma’as Sh., 2:9). For both of these kinds of transactions the shulḥani charged a small fee (agio), called in rabbinic literature a kolbon (a word of doubtful etymology but perhaps from the Greek κόλλυβος “small coin”; TJ, Shek. 1:6, 46b). This premium seems to have varied from 4 percent to 8 percent (Shek. 1:6, et al.). The shulḥani served also as a banker, and would receive money on deposit for investment and pay out an interest at a fixed rate (Matt. 25:27), although this was contrary to Jewish law. . . .

The activity of the Jewish banker, shulḥani, was of a closely defined nature, as his transactions had to be in accordance with the biblical prohibition against taking interest (ribit).

John Lightfoot’s commentary on Matthew 21:12 adds more relevant information:

[Overthrew the tables of the moneychangers.] Who those moneychangers were, may be learned very well from the Talmud, and Maimonides in the treatise Shekalim:– . . .

At that time when they paid pence for the half shekel, a kolbon [or the fee that was paid to the moneychanger] was half a mea, that is, the twelfth part of a penny, and never less. But the kolbons were not like the half shekel; but the exchangers laid them by themselves till the holy treasury were paid out of them.” You see what these moneychangers were, and whence they had their name. You see that Christ did not overturn the chests in which the holy money was laid up, but the tables on which they trafficked for this unholy gain.

Note that Jesus specifically concentrated on two groups: the moneychangers and those who sold doves. This was mentioned in the current account from Mark (above), and in the parallel stories (Mt 21:12-13; Jn 2:13-16). His anger at the moneychangers has just been explained. They were unlawfully extracting interest, which would hurt the poor the most. Why did He go after the dove sellers? It’s a similar reason.

Lambs were the usual sacrifice offered, but Leviticus 5:7 allowed those who couldn’t afford one to bring two doves or pigeons to the temple. Thus, those who sold doves often exploited and mistreated the poor. Hence, He described this scenario with these people who exploited the poor, as a “den of robbers” or “den of thieves.”

All Jesus cited was “My house shall be called a house of prayer” (Mk 11:17), which is from Isaiah 56:7. The point is that this is its central purpose: a place of worship and praise and prayer and ritual sacrifice: not of collection of unlawful interest and economic exploitation the poor, contrary to the Jewish Law.

Here is the passage Jesus cited, with some context as well:

Jeremiah 7:6, 9-11 . . . do not oppress the alien, the fatherless or the widow, or shed innocent blood in this place . . . [9] Will you steal, murder, commit adultery, swear falsely, burn incense to Ba’al, and go after other gods that you have not known, [10] and then come and stand before me in this house, which is called by my name, and say, `We are delivered!’ — only to go on doing all these abominations? [11] Has this house, which is called by my name, become a den of robbers in your eyes? Behold, I myself have seen it, says the LORD. 

The moneychangers and sellers of doves were stealing by extracting unlawful interest and excessive prices for items sold to the poor (the birds). 7:6 also states: “do not oppress the alien, the fatherless or the widow.” Thus the passage is exactly applicable. In  its larger context it lists many sins: two of which applied to the temple situation in Jesus’ time (stealing and exploitation of the less fortunate), and so He cited it accordingly.