He preached to all, but some of the supposedly "most righteous" were his enemies. They were smug, self-important and egotistical. The Pharisees thought they were better than everyone else. That's ego talking. And ego may well be the "devil" himself. Yep, living within each of us.
And the Holy Spirit? Also living within each of us. For most people, the Holy Spirit is asleep and the ego is wide awake. Those who are humble (last) have the ability to awaken their true self (Holy Spirit) and to subdue the ego -- the master of this world.
The prostitute, the thief and others were hungry for change -- hungry for an end to suffering. These were the most ready for salvation -- for the teachings of Christ, because they could feel the spirit awakening within them. The shackles of this world were no longer important to them.
Those supposedly most knowledgeable of God and His laws were the very ones who asked that Jesus be crucified. Perhaps they didn't know the law as well as they thought.