When you are critical of yourself,
you feel secure.
In your childhood, there might be someone (like your parents) who was critical. You developed a reflex of being critical toward yourself in order to gain approval from that person thus feeling secure.