There is only one righteous Judge of all humanity that all human judging ought to imitate which is God (Gen. 18:25; 2 Tim. 4:8; Heb. 12:23). He judges righteously by his righteous word. “My tongue shall speak of thy word: for all thy commandments are righteousness” (Ps. 119:172; cf. 19:7-9; 2 Tim. 3:16). “O let the nations be glad and sing for joy: for thou shalt judge the people righteously, and govern the nations upon earth. Selah.” (Ps. 67:4; cf. 96:13; Rev. 19:11). “Because he hath appointed a day, in the which he will judge the world in righteousness by that man whom he hath ordained; whereof he hath given assurance unto all men, in that he hath raised him from the dead” (Acts 17:31; cf. Rom. 14:10-12; 2 Cor. 5:10-11). “He that rejecteth me, and receiveth not my words, hath one that judgeth him: the word that I have spoken, the same shall judge him in the last day”
(John 12:48; cf. Rev. 20:11-12).
Many believe it is wrong for people to judge others but they are unaware that God commands it. Jesus said, “Judge not according to the appearance, but judge righteous judgment” (John 7:24). The Lord taught our standard of judging others should be righteous too. The only way for us to rightly do this is by the word of God. “All scripture is given by inspiration of God, and is profitable for doctrine, for reproof, for correction, for instruction in righteousness” (2 Tim. 3:16). Through the scriptures alone we are able to determine what righteousness is. Since everything which is consistent with God’s will/word is righteousness, we must conclude that anything that is contrary to God’s will/word is unrighteous and therefore wrong. “All unrighteousness is sin” (1 John 5:17). “…sin is the transgression of the law” (1 John 3:4; cf. Heb. 2:2; Jas. 4:17). So, if someone is sinning and the sin is pointed out, it is not that person who is judging them, but God who said the activity was wrong through his word.
This means many have misunderstood Matthew 7:1 that says, “Judge not, that ye be not judged.” Jesus is not saying to judge in John 7:24 and not to judge here in Matthew 7:1. This context is about unrighteous judging. We should righteously judge others the same way we want to be judged (Matt. 7:2,12). It is wrong and hypocritical to judge the wrong in others while ignoring our own (Matt. 7:3-5; 1 Cor. 11:28; 2 Cor. 13:5). However, it does not mean that one has to be perfect or sinless to judge others. No, just faithful. The Lord wants us to help others by correcting their transgressions through his word (Matt. 7:5; 28:19-20).