For such is the will of God that by doing right you may silence the ignorance of foolish men. 1 Peter 2:15
This verse appears in a section about obedience to the government. Peter tells his readers to submit themselves to every human institution that punishes evildoers and praises those who do right. The sentence is quite convoluted, so it's easy to get confused about its meaning. Every human institution? Even the corrupt ones? No, Peter explicitly states that we are to submit ourselves only to the institutions that punish the wicked and reward the just. If the institution itself is wicked, then obviously it is not punishing the wicked. Why are we to submit to righteous institutions? So that we might silence the foolish. This is done for the Lord's sake, and it is the will of God, even if, and especially if, we suffer in submission, because it is the right thing to do. So, never suffer for submitting to a wicked institution, but suffer for submitting to a righteous institution. Why suffer?
So that by doing right, we may silence the ignorance of foolish men. A few verses earlier Peter writes, "Keep your behavior excellent along the Gentiles (Peter is speaking to Jews, so Gentiles can mean "ungodly" or "unbelievers"), so that in the thing in which they slander you as evildoers, they may, because of your good deeds, as they observe them, glorify God in the day of visitation." This is a huge verse to unpack, and it is the heart of what Peter is trying to say to us.
We've got several things going on here: 1) keeping our behavior excellent, 2) being slandered as evildoers, 3) being slandered because of the excellent behavior, 4) glorifying God through the slander, and 5) glorifying God in the day of visitation.
1) What is excellent behavior? According to Paul, excellent behavior involves having good sense, keeping our doctrine pure (getting our doctrine only from within scripture, never from outside it), being dignified, keeping the words that come from our mouths sound and beyond reproach (Titus 2:6-8). So, in all we do, think, and say, we must be obedient to what the Bible tells us is acceptable and good. In Philippians, Paul goes further, telling us not to grumble or dispute but to be blameless and innocent in the midst of a crooked and perverse generation, appearing as lights in the darkness. This is an important point. With the image of lights in the darkness in mind, this verse seems to tell us to observe the dark ways of the unbelieving world and do the exact opposite, as lights would appear in darkness. There's a stark contrast here, and the image does help us.
2) Why are the righteous slandered as if they themselves were evildoers? To answer this, we go to the last chapter of Acts. Paul has come to Rome, having done nothing wrong, yet having to point to his Roman citizenship in order to not be killed by the Jews. The Romans are interested in hearing about Christianity, because "it is spoken against everywhere" (Acts 28:22). Paul preaches the gospel to them and continues to share the gospel each day, and some were persuaded, but others would not believe. This always happens, and it happened to Paul. Nothing was special about him to keep many from not believing. The plain truth is that many react violently negative to the gospel when properly communicated.
3) Also discovered in the same passage of Acts was that Paul had done nothing wrong, and yet he was still attacked. These are two sides of the same coin. Christianity is "spoken against everywhere" as if it were evil, and yet Christianity itself is the good way, where everlasting life is found. For this reason, Paul takes his message to the gentiles, because the Jews in Rome, the ones who are accusing him falsely, are falling prey to the unforgivable sin, the sin that is blasphemy against the Holy Spirit. To call good evil and evil good--and really mean it in your heart--is to walk a path of destruction form which one cannot escape.
4) How does this glorify god? The darkness trying to snuff out the light and failing is one of the true ways of glorifying God. When the reformers were burned, we had a false church trying to snuff out the light, and the neutral observers were persuaded into walking said path of light. When evil calls good evil and acts to destroy the good, people see, and the eyes of their hearts are opened. This glorifies God. Why is Christianity the most maligned religion in all the world? Because it is the true one.
5) Finally, the day of visitation is the day that Jesus returns to earth in judgment. Remember, the first time he came was not in condemnation but to save the elect through the proper presentation of the gospel--what Paul is also doing. We have everything we need to be saved through Christ. His second coming will draw a sharp sword down between true believers and those who accused them. Those who call good evil, those who persecute righteousness, they will be exposed and cut off at the end of everything. In the meantime, God allows the persecution of the righteous to take place, so that those who are on the fence can observe and take their sides in the battle.
Submit yourselves to righteousness, be slaves to righteousness, not because you are trying to save yourself, but because God has given you an abiding faith in his son. The world will tempt you to follow its lead, and if you resist, then the world will persecute you mercilessly. This is part of the plan. It draws you closer to the one who suffered on your behalf, and it opens the eyes of the hearts of those who witness the hostility. Christ died to save his elect. Certainly his elect can suffer unjustly for the glory of God.