He was not just the sum of the shame he had experienced in life. His identity and person were securely rooted in God. So, he was able to experience shaming experiences without internalizing the shame. Secondly, Jesus had 'joy set before him'. Experiences of shame hurt us.
Shame is always hurtful.
But we are not entirely defenseless. Jesus drew strength to endure shame from the anticipation of joy. Shame can be better endured if we allow ourselves to remember that God has plans for us that include joy. We are not aimlessly adrift in life, headed nowhere, wanderers in a meaningless maze. On the contrary, every day takes us closer to the fulfillment of God's purposes.