"We have a saying that we should not judge a book by its cover. We cannot judge a man’s heart or his motives unless by some means that is revealed. But we can judge sinful behavior."
The American phrase, "You can't judge a book by its cover" means that you can tell much about the content and quality of a book by looking solely at the book's cover. In the same way, you cannot tell much about a person by only looking at the surface circumstances.
As an example, Jesus was accused of doing something wrong simply because he was at a dinner where sinners and tax collectors also attended (Matthew 11:19). Another similar accusation was made when a sinful woman came and washed Jesus' feet.
"Now one of the Pharisees was requesting Him to dine with him, and He entered the Pharisee's house and reclined at the table. And there was a woman in the city who was a sinner; and when she learned that He was reclining at the table in the Pharisee's house, she brought an alabaster vial of perfume, and standing behind Him at His feet, weeping, she began to wet His feet with her tears, and kept wiping them with the hair of her head, and kissing His feet and anointing them with the perfume. Now when the Pharisee who had invited Him saw this, he said to himself, "If this man were a prophet He would know who and what sort of person this woman is who is touching Him, that she is a sinner." And Jesus answered him, "Simon, I have something to say to you." And he replied, "Say it, Teacher."
"A moneylender had two debtors: one owed five hundred denarii, and the other fifty. When they were unable to repay, he graciously forgave them both. So which of them will love him more?" Simon answered and said, "I suppose the one whom he forgave more." And He said to him, "You have judged correctly." Turning toward the woman, He said to Simon, "Do you see this woman? I entered your house; you gave Me no water for My feet, but she has wet My feet with her tears and wiped them with her hair. You gave Me no kiss; but she, since the time I came in, has not ceased to kiss My feet. You did not anoint My head with oil, but she anointed My feet with perfume. For this reason I say to you, her sins, which are many, have been forgiven, for she loved much; but he who is forgiven little, loves little" " (Luke 7:36-47).
Simon only looked at the surface and drew the inaccurate conclusion that Jesus was not a prophet.
Often our errors in judgment come because we don't know why a person acted as they were observed. We draw conclusions about their motives based on their apparent behavior, but sometimes those conclusions are wrong. "For who among men knows the thoughts of a man except the spirit of the man which is in him?" (I Corinthians 2:11). Unless a person chooses to tell us what he is thinking, we are left to only guess his motivations. Only in the final Judgment will we know exactly what happened. "Therefore do not go on passing judgment before the time, but wait until the Lord comes who will both bring to light the things hidden in the darkness and disclose the motives of men's hearts; and then each man's praise will come to him from God" (I Corinthians 4:5).
Jesus told us, "Do not judge according to appearance, but judge with righteous judgment" (John 7:24). Don't judge things by appearance alone, but dig deeper into matters. And at the same time, don't draw conclusions based on what you guess is motivating a person. Let me give a trivial example. You see a boy running out of a house. The door slams shut and you notice that the boy is frowning with tears welling up in his eyes. Do you conclude that he just had a scolding from his mother? What if you later learn that his dog had just died? Does that change how you thought about what you saw? All I can really conclude is that the door slammed and it is impolite to slam doors. But I can't conclude why the door slammed.
When we deal with false teachers, we are told to observe the results (the fruits) of what a false teacher does. "Beware of the false prophets, who come to you in sheep's clothing, but inwardly are ravenous wolves. You will know them by their fruits. Grapes are not gathered from thorn bushes nor figs from thistles, are they? So every good tree bears good fruit, but the bad tree bears bad fruit. A good tree cannot produce bad fruit, nor can a bad tree produce good fruit. Every tree that does not bear good fruit is cut down and thrown into the fire. So then, you will know them by their fruits" (Matthew 7:15-20). I can conclude whether a person is a false teacher based on the results of his actions and his teachings, but what I can't conclude is why the person is teaching falsely.
I can judge that stealing is wrong and if I observe someone stealing, I can rebuke the person for stealing because God stated that stealing is wrong. But unless a person tells me why he stole, I cannot judge his motives.