‘You should not judge’ is often used by masters and Gurus to keep their disciples and followers from questioning what they are doing.
If you made it your habit not to ever judge anything and anybody, you would get psychological problems as you would not be able to make independent decisions on your own and would never know which way to go.
There would be no development if nobody ever judged. You would always accept everything as it is. We need to judge.
People who judge often have an inferiority complex and believe others judge them. If you are in your full love to yourself, you don't need to judge others.