Checking with the Catena Aurea, I find St. John Chrysostom wrote this by way of explaining Jesus' rebuke of the Pharisees:
As much as to say; How do you accuse me for reforming sinners? Therefore in this you accuse God the Father also. For as He wills the amendment of sinners, even so also do I. And He shews that this that they blamed [i.e., eating with tax collectors and sinners] was not only not forbidden, but was even by the Law set above sacrifice; for He said not, I will have mercy as well as sacrifice, but chooses the one and rejects the other.
A gloss attributed to St. Anselm suggests:
Yet does not God contemn sacrifice, but sacrifice without mercy. But the Pharisees often offered sacrifices in the temple that they might seem to men to be righteous, but did not practise the deeds of mercy by which true righteousness is proved.
And from Rabanus:
He therefore warns them, that by deeds of mercy they should seek for themselves the rewards of the mercy that is above, and not, overlooking the necessities of the poor, trust to please God by offering sacrifice. Wherefore, He says, "Go;" that is, from the rashness of foolish fault-finding to a more careful meditation of Holy Scripture, which highly commends mercy, and proposes to them as a guide His own example of mercy, saying, "I came not to call the righteous but sinners."
I like Rabanus's final point, that Jesus' own example of mercy should guide our careful meditation on Hosea's prophecy. He himself has provided the one necessary and sufficient sacrifice. It now remains for us to carry the mercy manifested on the cross to the world.