At the cross, Jesus was stripped, suffering shame. He suffered the shame that we deserve. Because of our sins, we deserve to be stripped and shamed. In his commentary on John 19:23-24, Matthew Henry explains:
"The shame they put upon our Lord Jesus, in stripping him of his garments before they crucified him. The shame of nakedness came in with sin. He therefore who was made sin for us bore that shame, to roll away our reproach. He was stripped, that we might be clothed with white raiment (Rev. 3:18), and that when we are unclothed we may not be found naked."