The cross is seen as the supreme example of God's love for us, but many struggle to understand why Jesus had to die or if He had to die at all. There's no one right answer, but the Bible offers us glimpses or clues as to what Jesus's death really means for our lives. Traditionally, these “answers” are called atonement theories.
While this answer – exposing sin of the community – may sound different to you, many people who are in marginalized, oppressed, or outsider communities find this theory deeply compelling. They find solidarity with Jesus as a person who, like them is blamed, and punished by the people of his time. But while often people are scapegoated and forgotten, that is not what happens to Jesus.
Instead, by dying and being resurrected, God vindicates Jesus as innocent and exposes the sin of the people and force them to see the sin in their own life. The crucifixion then is meant to function like a mirror that is both hard and hopeful.