Judging motives is a Christian duty
In different parts of a city, two drivers strike and kill a pedestrian. The first one sped up, ran a red light, swerved toward the pedestrian and killed him. The second driver was driving to work when a pedestrian jaywalked in front of him without warning. The driver slammed on the brakes and attempted to swerve, but was unable to avoid a collision. He then stopped, called 911, and attempted to administer first aid until the ambulance arrived.
In both cases, a person is dead. Someone who may have been a sibling or parent, and was someone's child. Both died at a young age. Should both drivers be punished equally for the deaths of those pedestrians? Obviously not. The entire basis of the criminal justice system is judging motives. Murder is different than recklessness, which is different than an unavoidable accident.
Jesus tells us to judge righteous judgment in John 7, and warns of the motives of hypocrites in Matthew 6. Jesus judges the motives of the Pharisees in Matthew 23. Lest we think that should be reserved only for the Lord, the Apostle Paul warns in Philippians 1:16 that some "preach Christ of contention." Paul also warns of "grievous wolves" seeking to "draw away disciples" in Acts 20:29-30.
The fact of the matter is that some people have bad motives, and those people should be exposed. We should not be afraid of doing that, but we should do so in charity. There are many times that even when someone is wrong, he may be acting out of good motives. It is important to practice discernment, but also avoid the temptation to fall into cynicism. This is a hard line to walk and our judgment can be clouded by our own sin - but that does not mean that all human judgments of motives is wrong.