Jesus wasn't telling us that we ought to be gullible or naive about others, or that we should overlook the reality of human failure and sin -- not at all. Jesus wasn't naive about those who claimed to follow Him but in reality couldn't be trusted: "Jesus would not entrust himself to them, for ... he knew what was in a man" (John 2:24-25).
Look carefully at Jesus' actual words: "Do not judge, or you too will be judged. For in the same way you judge others, you will be judged" (Matthew 7:1-2). Jesus here was reminding us that God alone is our eternal judge, and we must never think we can take His place. Some day, we all will stand before Him, and He alone has the power to condemn or save us. He alone also is able to see our hearts, and He alone knows whether or not our faith in Christ is real.
Jesus' words are also a warning against pride -- against thinking we are better or more righteous than others. In God's eyes, we are all guilty, for we have all sinned against Him and turned our backs on His will for our lives. The Bible says, "There is no one righteous, not even one" (Romans 3:10).This is why we need Christ, for by His death on the cross He took upon Himself the judgment we deserve. Is He your Savior? Make sure, by committing your life to Him today.