Jesus began his ministry by announcing what type of people receive God's favor. People, generally, thought it was people — like the Pharisees — who were serious, and worked hard, at obeying the Law.
So, Jesus turns the world upside down. Those, like the Pharisees, thought they were earning right standing with God. But, Jesus knew that no one can earn right standing with God. Those, who God favors, recognize, and accepted, this truth.
All people stand as beggars before God. Ones, who have learned that wisdom, accept their poverty stricken status. They accept that, before God, they have nothing to give. They can only receive.
It is pretty dumb to strut around, like one has it all together, like one is self-sufficient, with need, and one is dressed in rages, without sufficient means to feed one's self. Yet, that was precisely the position of many Pharisees and priests.
"We are accepted, and blessed, by what we do. God thinks we are better than the tax collectors, sinners, and gentiles."
And that is precisely why God did not give them his favor.
There were tax collectors, sinners, and gentiles, who saw the worth of the God of Israel, and sought to know him. And God favored them above the self-righteous ones.
God values those who realize that the do not have the power to stand before on their own merit. They are closer to him, than those involved in lots of religious activity. They are more ready to turn to Jesus, and walk across the bridge he built for them. They are more ready for a relation with the Father of creation, because they have a true view of reality, and a true understanding of their standing before God.