The purposes of government will depend on the type of government - a medieval monarchy government may have different purposes from a modern democratic government.
In general, a government will provide security both internal law and order among its citizens and protection from external threats. It will take on municipal services for its citizens. It will provide a stable living environment and ensure continuation of the government itself.