Here, he is quoting the prophets (not "the law," Moses) Isa 56:7 ("house of prayer") and Jer 7:11 ("Den of robbers"). As is usual, Jesus's Greek follows the Greek Septuagint exactly, word for word.
The original Greek is more colorful, contrasting the "house of prayer" not just with a "den of thieves" but with "a cave of priates." The temple of Jesus's time was called a place of sacrifice.
This is the first mention of the word "prayer" by Jesus in the Gospels, but he only uses it five times total. He earlier talks about praying, but doesn't use the noun.
Christ's Words in Matthew as a Guide to 40 Days of Prayer.