So He said to them, "You are those who justify yourselves before people; but God knows your hearts. That which is highly valued by people is an abomination before God. Luke 16:15 (CCNT)
We justify ourselves in every action that we do because we want to appear like everything is going alright. We don't want it to appear that we don't have it all together or that there is some shameful sin in our life. We want it to appear that we are very generous and that we are so full spiritually of the Holy Spirit that we are just overflowing with love toward others. We want to be thought of as spiritually mature but there is sin in our lives that no one knows about that, if they knew, we would never show our faces again there in church. If the women knew what we were thinking; if our wives knew what we thought about other women, we would be ashamed to say the least. How would we face them?
21 "Not everyone who says to Me, 'Lord, Lord,' will enter into the empire from the heavens, but only the one who does the will of My Father Who is in the heavens. 22 Many will say to Me in that day, 'Lord, Lord, didn't we prophesy in Your Name, and didn't we cast out demons in Your Name, and didn't we do many miracles in Your Name?' 23 And I will declare publicly, 'I never knew you; get out of here, you workers of lawlessness!' Matt 7:21-23 (CCNT)
When we say 'Lord, Lord' it is because we have no idea that we aren't saved and we think that we are. We have this idea that all our external good works actually had power to justify us before God. It is like they are thinking, "Didn't everyone else think that we were righteous, God? If we succeed in leaving this earth as being thought of as a great Christian, doesn't that mean that You have to accept us?"
In Luke 16:15, the focus is on the justifing ourselves before men. This is the inner machinations of the heart in that we think that what we desire is what God should desire too. What we desire is our happiness and we think that that is God's purpose to fulfill. All we need to do is make sure we don't hurt too many people and we are philanthropic to those who we view as humble and kind. That is how we justify ourselves before men. That is the hearts motivation that produces the self-righteous deeds in Matthew 7:22.
The test for the self-jusifyer is when things don't go his way. This means that God is not consenting in giving them what they think makes them happy. "When mama ain't happy, ain't nobody happy". They make the whole world suffer with them and of course, like Cain their brother, they step on anyone who makes them look bad or who gets the accolades they feel they should have received.