Jesus quoted the above verse from Hosea 6:6 twice (at least the times someone told us about it). Matthew records both instances. The quote is found in verses Matthew 9:13 and Matthew 12:7.
Both times Jesus is talking to the Pharisees after they are offended by what Jesus allows and does. Both times interestingly deal with food in a manner.
In the first reference the Pharisees don't understand why Jesus eats with "tax-gatherers and sinners."
The don't ask Jesus. They ask His disciples why He does this. But Jesus answers them. He says, "It is not those who are healthy who need a physician, but those who are sick. But go and learn what this means, 'I desire compassion, and not sacrifice,' for I did not come to call the righteous, but sinners." Matthew 9:12-13
In the second reference Jesus' disciples are picking grain heads and eating them because they are hungry. The pharisees were for some reason watching this happen and they accuse Jesus. They say, "Behold, Your disciples do what is not lawful to do on a Sabbath." Matthew 12:2
Jesus throws it right back at them using scripture and a reference about David and his men eating sacred bread. Then He says to them, "''But if you had known what this means, 'I desire compassion, and not a sacrifice,' you would not have condemned the innocent.'" Matthew 12:7
The first time Jesus encourages the pharisees to "go and learn" what compassion is. The second time He says if they had understood the scripture they wouldn't accuse the innocent.
We Believers can become like the Pharisees easily if we don't stay flexible and plugged into Jesus. God is creative. He doesn't do what He does in predictable ways. He likes to shake things up. We need him too or we end up getting stale and hollow.
We have no time to be offended, especially by those who do things differently than we do. Before you speak, listen and learn. Show compassion. Show mercy. Don't throw a bunch of rules at anyone. Just because you get someone to follow a bunch of rules and make them look like a "good christian" doesn't mean his heart is changed. In fact, it probably isn't.
Let God do the changing. Our job is to show compassion, understanding, kindness, love. This world's inhabitants don't need to be condemned by the ones who could show them the Way.