It’s why the Jews have had such trouble believing he is the Messiah (among a number of things). But anyone condemned to death and hung on tree was “under God’s curse” (21:23). And that’s one place you didn’t want to be.
Jesus literally came under the curse of God on the cross. For us.
So that we didn’t have to.