According to John Locke, what is the purpose of government?

According to John Locke, what is the purpose of government?