“The only proper purpose of a government is to protect man's rights, which means: to protect him from physical violence... The only proper functions of a government are: the police, to protect you from criminals; the army, to protect you from foreign invaders; and the courts, to protect your property and contracts from breach or fraud by others, and to settle disputes by rational rules, according to objective law.”
~ Ayn Rand
In a state of nature, men are allowed complete discretion in the use of force in self-defense and in the pursuit of justice. However, a lack of objective legal control over the use of force is anarchy: a perpetual state of civil war and warfare. Government is the agency that enforces objective control of force by having a monopoly on the legal use of force. This monopoly may be used for only one just purpose: to carry out justice against those who initiate force according to objectively predefined laws. Thus, the sole function of government is to protect individual rights by defending its citizens and retaliating against those who initiate force.
Just as no individual has the right to initiate force against anyone, neither does any group of men, in any private or public capacity. It is immoral to initiate force against any individual for any reason. This includes the initiation of force for the public good. The public is merely a collection of individuals, each possessing the same rights, and each being an end in himself. Any attempt to benefit the â€œpublic good is an immoral attempt to provide a benefit to one group of individuals at the expense of another. In a free society, no individual benefits at the expense of another: men exchange the values they create in voluntary trade to mutual gain.
Therefore, the sole function of government is to protect individual rights by establishing a legal monopoly on the use of force. It does so by three agencies: The police protect against domestic criminals, the courts settle honest disputes, enforce contracts, and punish criminal according to objectively predefined laws, and the military provides protection against foreign invaders.
To ensure that the government respects individual rights, and that politicians cannot turn the power of the police against any of its citizens, the power of government must be strictly defined according to objectively defined laws. The rule of law has just purpose: to protect the rights of the individual.
The basic purpose of a government is enshrined in its constitution. The purpose of a constitution is to explicitly define the valid powers of government. Thus, a citizen remains to free to do whatever is not explicitly forbidden by law (in a proper legal system, that is solely the initiation of force), but an official of the state is only allowed to carry out what is explicitly permitted. A capitalist government is not the mob rule of democracy, but a constitutionally limited federal republic.