Beneath the surface, things are always much more complex than we realize. When discussing someone behaving in a non-ehrlich manner it’s important to realize that the question of “who is ehrlich” is not as simple as we may think. A well-known story illustrates this idea: A man was visiting a different town and was horrified to see men and women greeting each other before entering the shul to daven — some even outright inappropriately!
Then, during davening, he noticed the gabbai call up a man for an aliyah. Another man objected: “You’re giving him an aliyah? Yesterday, I heard him tell a lie!”
The visitor was taken aback. Where he came from, a lie was... well, it wasn’t good, of course, but certainly nothing that would deprive a person of an aliyah. And he had been so quick to condemn the people of this town for what he saw as their terrible behavior between men and women.
This is not to say that being stringent in one area compensates for laxity in any other area — chas ve’shalom. However, it is important to remember this concept whenever we see a person doing an aveirah that we consider “terrible.” Perhaps we do things that the other person considers “terrible”? And yet we see ourselves as ehrlich — perhaps that person sees himself as ehrlich, too? Perhaps his scale of priorities in mitzvos is simply different from our own, for good or for bad?
Another important aspect that is hidden beneath the surface of what seems obvious is the level of challenge each person experiences in living according to the Torah. What may be a huge nisayon for one person is no challenge at all for someone else, who looks at that other person and thinks, “How could he do that?” Only Hashem knows how hard or easy it is for a person to overcome his yetzer hara.
Furthermore, only Hashem knows how many times a person actually was misgaber in the past, before eventually falling. And only Hashem knows how much a person regrets falling, and how he picks himself up again and tries once more. Even if a person has seemingly fallen entirely into bad ways, no one but Hashem knows if he doesn’t sigh and regret and try harder and still fail and sigh again... Only Hashem knows that this person, however low he has fallen, still wants to be the best Yid he can be, and serve Hashem in the most devoted and committed manner.
Regarding the obligation to be dan lekaf zechus where the Torah demands it, Rav Chaim Volozhiner ztz”l asks: But what if I actually saw that person doing an aveirah? Should I then fool myself and pretend it didn’t happen?
He explains that this is not what judging favorably means. Yes, the person acted wrongly. We must not ignore it or look the other way or downplay what happened, as this could cause us to become apathetic to the gravity of the aveirah. He explains that being dan lekaf zechus means that we recognize how serious it is to flout the laws of the Torah, and that we look at others with compassion for being unable to overcome their challenges.