There are two sections of the New Testament that both speak clearly and directly to the two purposes of government, and both can also easily be misused.
This post is an attempt to give clarity to these passages, the purposes of government, and how Christians should respond to governments that do and do not stay within these purposes.
Paul wrote to the church in Rome, the capital of the world at the time, about the role of government. The first four verses of Romans 13:
" Let every soul be subject to the governing authorities. For there is no authority except from God, and the authorities that exist are appointed by God.  Therefore whoever resists the authority resists the ordinance of God, and those who resist will bring judgment on themselves.  For rulers are not a terror to good works, but to evil. Do you want to be unafraid of the authority? Do what is good, and you will have praise from the same.  For he is God's minister to you for good. But if you do evil, be afraid; for he does not bear the sword in vain; for he is God's minister, an avenger to execute wrath on him who practices evil."
While it indeed says, the ruler "is God's minister to you for good," it also gets very specific about what he does that makes for that ministering for good.
First, rulers are "a terror ... to evil" (v. 3) and "to execute wrath on him who practies evil" (v. 4). Second, he will give "praise" to those who "Do what is good" (v. 3).
1 Peter 2
Peter identifies the exact same two purposes for government: " Therefore submit yourselves to every ordinance of man for the Lord's sake, whether to the king as supreme,  or to governors, as to those who are sent by him for the punishment of evildoers and for the praise of those who do good" (1 Peter 2:13-14).
Governors are sent by him to punish evildoers and praise those who do good. Those two things, as the Bible explains, are the fundamental purposes of any government of men that has, does, or will exist on earth.
This also forms the Biblical basis for civil disobedience: when government goes outside punishing evil or praising good, especially punishing good, then civil disobedience is appropriate.
The apostles said as much when they concluded, "We ought to obey God rather than men" (Acts 5:29). There is a Biblical place for civil disobedience, and it's very important to be crystal clear on where that is.
If one is not clear on these issues and the full context of these passages, then one can easily be mislead into thinking that "God's minister to you for good" or "submit yourselves to every ordinance" would mean we should always obey government, and that is not the case.
Necessity of Government
The only reason earthly government of men must exist is because evil must have consequences. Good does not need consequences. Thus the main purpose of government is to punish evil. I believe God in his wisdom gave the role of praising good as an additional role for government to balance out government's role with punishing evil.
It's also important to note there are inherent problems with government ever going beyond praising good to promoting good or doing good itself.
December 2013 Update: Some of the language in this post was updated from "roles" to "purposes."