We find it in Matthew 9:13 and Matthew 12:7. He was talking to the Pharisees. Men who had mastered the relationship with God by means of all their rules and prohibitions. But they also lacked warm love for God and their neighbours. There Jesus denounces them as deceivers of the people and then uses the words of Hosea 6:6 to show what God really values. Thus, this verse indicates the ancient and fundamental rule for God’s relationship with his people, even today. Doing something for the Lord but not really listening to him and giving your heart to him is the opposite of true love. The prophet Samuel reproaches King Saul in 1 Samuel 15:22 for the same thing.
6 For I desire steadfast love and not sacrifice, the knowledge of God rather than burnt offerings.