It is to show God’ holiness and righteousness, the chance to repent is God’s grace, but not everyone could get it.
Ananias and his wife sold a piece of property. He and his wife kept back part of the money for himself, but brought the rest and put it at the apostle’s feet. He died because he lied to the Holy Spirit, so did his wife. Why did not the apostles gave them a chance to repent ?
The first church of God, like the first seed, must never be a mixture of gods and selfish spirits and vandalism. Otherwise, the first seed is unhealthy and impure, so it is impossible to produce healthy and pure seeds in the future.