The word "sin" is a metonym for the sacrifice that is offered so that God will forgive sin. Alternate translation: "to become the sacrifice for which God will forgive our sins"
The phrase "the righteousness of God" refers to the righteousness that God requires and that comes from God. Alternate translation: "so that through Christ we might have the righteousness that God requires" (See: [[rc://en/ta/man/jit/figs-explicit]])