1st Century Palestine was governed by a harsh, pagan dictatorship, bent on taking advantage of the people they governed, extracting their resources and wealth for the good of the central government in Rome, and oppressing the local people to ensure they did not rise up and revolt against the government. The Romans tolerated religion only insofar as it yielded ultimately to the ultimate form of power, the worship of Caesar as lord.
In this political environment lived a small group of men who worshiped the one true God. They studied the Scriptures, and observed every command to the extreme, exhorting all around them to do the same. These men longed for the Palestine of centuries past, when the people lived under a government loyal to God, and the king was a “man after God’s own heart.” These men even studied the Scriptures to more fully understand the prophecies of the Messiah, the one who was to come and establish God’s kingdom on earth, longing for the day when they could throw off the bondage of the pagan dictatorship and live under the authority of a government based on Godly principles.
Another group of men in Palestine did not revolt against the Roman government, they embraced it, allying with the pagans in their attempt to extract wealth from the locals. These “publicans” gathered the taxes from the local residents on behalf of the Roman government, and collected a little (or a lot) extra for the purpose of building their own personal wealth. The historical record reveals that the former group treated the publicans with unbridled contempt, despising them for their moral compromise of Scriptural principles for economic gain.
Against this backdrop, the Son of Man, the Holy One of God whom the Scriptures foretold, taught of the coming Kingdom of God which He himself was establishing. He spent a lot of time with both of the aforementioned groups, speaking to and about each, often in earshot of the other. Of one group he spoke with mercy, often citing them in his stories of God’s love and forgiveness. Of one he spoke harshly and contemptuously, unapologetically offending them in his scathing criticism of their use of position to selfishly advance their own interests.
To some who were confident of their own righteousness and looked down on everybody else, Jesus told this parable: “Two men went up to the temple to pray, one a Pharisee and the other a tax collector. The Pharisee stood up and prayed about himself: ‘God, I thank you that I am not like other men—robbers, evildoers, adulterers—or even like this tax collector. I fast twice a week and give a tenth of all I get.’
“But the tax collector stood at a distance. He would not even look up to heaven, but beat his breast and said, ‘God, have mercy on me, a sinner.’
“I tell you that this man, rather than the other, went home justified before God. For everyone who exalts himself will be humbled, and he who humbles himself will be exalted.” (Luke 18:9-14, NIV)
Jesus did not approve of the actions of the publicans (tax collectors). One can be certain that he despised their sins, as God despises all sin. But Scripture reveals that Jesus only spoke with open contempt and criticism of one group of people: those who took pride in their own righteousness and condemned others for not meeting their religious standards; of this group his condemnation is unvarnished and explicit (cf. Matt 23).
I relate all of this, not to judge the speech or motives of others, but to make the point that Jesus was VERY selective in how he spoke of his fellow man. In his teachings he speaks very strongly against adultery (Matt 5:27-30). But when he speaks to or about adulteresses, he speaks with mercy and compassion (See John 4). We (I am first among the “we”) should be of like mind.