The temple had become a place of people taking advantage of others, making money for themselves and not caring about this Holy place of God.
Read on Bible Gateway
12 Jesus entered the temple courts and drove out all who were buying and selling there. He overturned the tables of the money changers and the benches of those selling doves. 13 “It is written,” he said to them, “‘My house will be called a house of prayer,’ but you are making it ‘a den of robbers.’”
14 The blind and the lame came to him at the temple, and he healed them. 15 But when the chief priests and the teachers of the law saw the wonderful things he did and the children shouting in the temple courts, “Hosanna to the Son of David,” they were indignant.
16 “Do you hear what these children are saying?” they asked him.
“Yes,” replied Jesus, “have you never read,
“‘From the lips of children and infants
you, Lord, have called forth your praise’?”
17 And he left them and went out of the city to Bethany, where he spent the night.