Imagine a scenario for me. Joe Unbeliever is walking down the street and notices a poor old woman being mugged. He intervenes. He chases down the mugger and gets back the woman’s belongings. Joe risked his health, maybe even his life, for his neighbor. Joe is a hero, right? But did Joe do a good work? It depends on what we mean and in whose view he’s standing.
Joe certainly did a good work in our eyes, in the eyes of the world, of his fellow citizens, that is, coram mundo. Joe deserves commendation, a medal, or award. Joe did a good thing. We need more Joes. This world would certainly be a better place. Joe is a righteous man coram mundo. We’re proud of Joe as a community. We’re thankful. Joe serves as a good example for our children. We can call this civil righteousness.
Is Joe Unbeliever going to heaven now, though? Well, there’s only one way to heaven, and that is by grace, through faith in Christ. Joe did a good work but Joe isn’t forgiven. Better yet, Joe hasn’t been absolved. Christ died for Joe’s sins and rose for his justification. Christ is the Lamb of God for Joe as He is for everyone else. Joe, however, is Joe Unbeliever. Joe did a wonderful thing, but he didn’t do it in faith, and it’s only in and through faith that a work is pleasing to God, that a person is righteous in God’s sight, or coram deo. Joe isn’t righteous in God’s sight, because work-righteousness doesn’t avail before God. Paul is blunt about it. He makes clear that “whatever does not proceed from faith is sin” (Rom. 14:23).
The second righteousness, the righteousness that avails before God, divine righteousness, isn’t done, but only received. It’s rooted, not in our doing, but in our not doing—we’re passive, not active, with respect to this righteousness.
The Apology to the Augsburg Confession explains the two kinds of righteousness and the need to distinguish them like this:
Therefore, it is helpful to distinguish between civil righteousness, which is ascribed to the free will, and spiritual righteousness, which is ascribed to the operation of the Holy Spirit in the regenerate. In this way outward discipline is preserved, because all people alike ought to know that God requires civil righteousness and that to some extent we are able to achieve it. Nevertheless, it reveals the distinction between human and spiritual righteousness, between philosophical teaching and the teaching of the Holy Spirit to understand this. Nor did we invent this distinction, for Scripture teaches it most clearly. 
Luther’s preface to his 1535 commentary on Galatians is magnificent on this. Luther sets the stage this way:
We set forth two worlds, as it were, one of them heavenly and the other earthly. Into these we place these two kinds of righteousness, which are distinct and separated from each other. The righteousness of the Law is earthly and deals with earthly things; by it we perform good works. But as the earth does not bring forth fruit unless it has first been watered and made fruitful from above—for the earth cannot judge, renew, and rule the heavens, but the heavens judge, renew, rule, and fructify the earth, so that it may do what the Lord has commanded—so also by the righteousness of the Law we do nothing even when we do much; we do not fulfill the Law even when we fulfill it. Without any merit or work of our own, we must first be justified by Christian righteousness, which has nothing to do with the righteousness of the Law or with earthly and active righteousness. But this righteousness is heavenly and passive. We do not have it of ourselves; we receive it from heaven. We do not perform it; we accept it by faith, through which we ascend beyond all laws and works. 
The church through the gospel produces citizens who have a peace that surpasses anything this world, any system of government, or any economic program can offer.
As you’ve figured out by now, this all runs counter to human instinct and natural human religion. That’s how God chooses to operate, however, and God is free, even as we are only truly free in God. Both kinds of righteousness are necessary and both are important, but they are different and must remain so.
The world runs on civil righteousness. Good citizenship makes for a more peaceful land. Good laws help people be productive in their stations, for themselves but also for their neighbors. Civil righteousness isn’t something to be derided or downplayed, but it must always be seen by the Christian for what it is. It’s not the paramount righteousness for the Christian. It’s a bridled righteousness, curbed by the threats of the law and driven to a certain extent by self-interest. That is not a description of the Christian life, but that is how society operates and even flourishes. We want to encourage good citizenship. Indeed, as the church we want to produce good citizens. Yet we want to produce good citizens, not because they are bridled and driven by the law and one’s own benefit, but because they have a greater righteousness. The church through the gospel produces citizens who have a peace that surpasses anything this world, any system of government, or any economic program can offer. These citizens are truly free with a freedom that needs no constitution, because it has an absolution.
With that in mind, then, we can speak about what Lutherans have historically called the two kingdoms or two realms. There are various names we can use for these kingdoms, realms, or governments. We can talk about spiritual and secular, church and state, eternal and temporal. These two spheres are not completely separated, even in America. They intersect in various ways, from education to charities to hospitals to marriage and burial. They do, however, each have different claims on us and different aims, and they don’t operate on the same basis.