The money changers took the peoples' money and exchanged it for the temple coins for a fee.  The temple coins were needed to purchase the kosher sacrificial animals.  It was a big racket and Jesus tipped the tables because it ripped off the people who were only trying to please God by following the Law.  They took advantage of a requirement for sacrifice.