The deaths of Zimri and Cozbi helped remove sin from the community of Israel. Their judgment stopped the spread of sin among the people.
Phinehas’s action had atoning value. This means it helped turn away God’s judgment and restore the people’s relationship with him. His act brought cleansing and peace to Israel (see study note on Leviticus 1:4).