Previous Reading
Matthew 6:19-34 – Serve God and do not worry
Next Reading
Matthew 7:7-14 – Ask and it will be given
Do not judge but be discerning

Did you notice that Jesus taught us not to give what is holy to the dogs nor throw our pearls before the pigs, after He taught us not to judge others? Are these two items meant to be separated as two different chapters under two different titles? I believe that apostle Matthew, led by the Holy Spirit, wrote it in this way, placing the two items together, to tell us that while Jesus taught us not to judge nor condemn others, He also want to caution us to be discerning.
As children of God, we should have the compassion that our Father has for people. Jesus did not condemn the woman caught in adultery (John 8:10-11) nor the Samaritan woman who had had five husbands (John 4:16-19). Jesus understood the brokenness in them and directed them to His light (John 8:12) and His Spirit (John 4:13-14).
However, we should also have the wisdom to discern who are the wolves in sheeps skin (Matthew 7:15, 10:16). As believers, we have the Holy Spirit who will guide us into all truths (John 16:13). If we do not seek God in our decision making (Proverbs 3:5-6) or even brush things away after the Holy Spirit has revealed some truths to us, we will end up sacrificing or giving what is precious to us, to people who would not treasure or appreciate us.
Jesus had taught us in Matthew 7:15-23 that we identify the evil people through their fruits. A good tree cannot produce evil fruit neither can a corrupt tree produce good fruit.