Judge not, that ye be not judged.
Note 46 at Mt 7:1: On other occasions, Jesus told people to judge (Lu 12:57 and Joh 7:24). The disciples told people to judge (Ac 4:19; Ro 14:13; 1Co 5:12, 6:2, 10:15, 11:13, and 14:29). Paul judged (1Co 5:3 and 2Co 5:14). There are many examples of people judging. Paul prayed that our love would abound more and more in all judgment (Php 1:9). In the light of these scriptures, it is evident that there must be a right and wrong type of judging.
In Lu 12:56-57, Jesus used the words "discern" and "judge" interchangeably. As defined by the American Heritage Dictionary, "judge" can mean many things from "condemn" to "to form an opinion or evaluation." There certainly is nothing wrong with discerning or appraising a situation or person. Quite the contrary, we need to try the spirits (1Jo 4:1). Judging, when done as discernment, is good.
It is the condemning type of judgment that is wrong. This is denounced in other scriptures (Ro 14:4, 10, 13; and Jas 4:11) because of the reasons stated in Mt 5:22. We can defer to God passing sentence on people and know that He will have perfect judgment (Ro 2:2 and Re 20:12-13).
Also notice that in these scriptures, Jesus was not forbidding judgment; He was warning us to be careful with our judgments because we will be judged accordingly. This same principle is stated in Ro 2:1-3 and Jas 2:12-13. There are certain cases where we have to pass a condemning sentence, as Paul did (1Co 5:3-5 and 1Ti 1:20), or as a judge would today. Pastors and elders are charged with rebuking and even disciplining church members (1Ti 5:20; Re 2:12-16, and 18-20), but it is not something to be done lightly. This warning constrains us to be certain that we have heard from God and are not simply venting our own frustrations.