Perhaps when you have negative ideas about yourself, even possibly ones you don’t know you have, you paint your ability to perceive yourself as good into a corner, or compartment. You perhaps do this by only allowing yourself to be or to be aware of that part of you or that set of behaviors or thoughts that you judge as good, and/or maybe having a shadow side of you that you judge or view negatively but are too afraid to look into. Perhaps “viewing negatively” there means being afraid of letting it see the light of day for fear of condemnation by others and hence hurt.
Having this compartment in yourself then means that your ability to see others as good is painted into that compartment as well. So we end up thinking we’re good ourselves while fiercely judging anyone else who doesn’t fit our one-sided model of what makes a good person.