One of the fundamental principles of Christianity is revelation. Not the book, but the action. Not only does God reveal himself to us, but he also reveals the true nature of things, including people. In Matthew’s gospel there are two back-to-back parables revealing the possible natures of people: righteous or wicked.
In the Parable of the Sower (Matt 13.3-9, 18-23) Jesus reveals the nature of those who are righteous: they have truly believed the Gospel and have received the Holy Spirit. Because of this they are able to endure persecutions and tribulations and they are not deceived by riches or fame or influence or politics or other worldly matters. No matter what comes their way they triumph over it and continue to grow spiritually.
In the Parable of the Weeds (Matt 13.24-30, 36-43), sometimes called Tares, the nature of the wicked is revealed. The parable begins with the image of a field that a man sowed with good seed having weeds sown by an enemy. The weeds (ζιζάνιον, zizanion) in question are probably what we call darnel today. It has large seeds and without modern sorting technology it is virtually impossible to separate from the desired wheat seed. It was likely already present in any field in the ancient world and everyone knew the deleterious effects it could have. It is poisonous to humans and can kill animals if given a high enough dose. It could also possibly infect normal wheat seeds. On top of all this it competed with the wheat for soil nutrients, water, and sunshine. Its roots were also entwined with roots of the wheat, which meant that it could not be removed without also likely harming the wheat that the farmer desired.
Now, remember, Jesus is revealing a spiritual truth for us here, not describing ancient agricultural practice. The opening image of a field being free of darnel would likely have been odd to the hearers because the darnel was probably already there. It wasn’t a matter of if a field would have darnel, but how much. This spiritual meaning is made explicit in the interpretation beginning in Matt 13.36. The field is the world, which was created by God, not a literal field. Seed (σπέρμα, sperma) is also not a literal seed that you plant in the ground, but spiritual descendants (see Ro 4.16, 18, 9.8; Gal 3.29 for similar uses).
This is why only good seed is present in the field because what God created, including humanity, was good. Eventually though Satan deceives humanity and brings sin into the world, thus creating his own line of spiritual descendants (Gen 3.15). From that point on the followers of God and the followers of Satan occupy the same world (field) indistinguishable from each other, at least at first. Even a household can be divided with some being good seed and others being bad seed (Matt 10.34-39).
Eventually everything that is covered or hidden will be revealed (Matt 10.26; Luke 8.17, 12.2) in the final judgment at the end of the age (Matt 13.39). Wheat inevitably produces wheat and darnel inevitably produces darnel; you cannot hide who are from God. The lives of the righteous are marked by endurance and perseverance through all sorts of trials, tribulations, and temptations. Not the absence of these things, but the triumph and overcoming and enduring of these things. No matter what comes their way they continue to follow God and become more like Christ. The lives of the wicked are marked by disaster and destruction; they do not overcome such things.
God is not interested solely in our deeds or what we do because even the wicked can do good things, and just because we do good things for God does not mean that God will acknowledge us as his (Matt 7.22-23, “I never knew you” = you are not my spiritual descendant in this passage. See 1 Cor 8.3, Gal 4.9 for similar uses). The wicked can fake many things; they cannot fake being known by God. Jesus knows who are his and who are not (John 10.14, 27) and those who are his he leads to eternal life. They will shine like the sun in the kingdom of their Father (Matt 13.43).
It is in this context that we should see judgments like Achan (Joshua 7.25-26), Judas Iscariot, and Ananias and Sapphira (Acts 5.1-11). These are not incidents of God being mean or petty. No. God is revealing the true nature of these people: they are darnel, not wheat. It doesn’t matter that Achan helped the Israelites conquer Jericho. It doesn’t matter that Judas Iscariot was one of The Twelve. It doesn’t matter that Ananias and Sapphira donated money to help the church. In all these incidents they imitated the righteous, but they were not the righteous and God revealed them as such.
The fates that these suffered were judgment for them, but protection for us who belong to Christ.
In closing I leave you to consider the following words of Jesus:
“Do not think that I have come to bring peace to the earth. I have not come to bring peace, but a sword. For I have come to set a man against his father, and a daughter against her mother, and a daughter-in-law against her mother-in-law. And a person’s enemies will be those of his own household. Whoever loves father or mother more than me is not worthy of me, and whoever loves son or daughter more than me is not worthy of me. And whoever does not take his cross and follow me is not worthy of me. Whoever finds his life will lose it, and whoever loses his life for my sake will find it. - Matthew 10.34-39