Let's not get lost in the details. The two goals are:
(1) Endure
(2) Expand
In other words, a punctual rephrasing of "be fruitful and multiply."
Everything else (keeping peace, waging war, making and enforcing laws, providing social services etc., etc.) is an inevitable, but strictly incidental set of consequences. Like defecating for living things: inevitable, but hardly raison d'etre.
More like means to those ends.
Charles Tilly distinguishes four activities performed by the State, as those "biological functions":
war making (“eliminating or neutralizing their own rivals outside the territories in which they have clear and continuous priority as wielders of force”), state making (“eliminating or neutralizing their rivals inside those territories”), protection (“eliminating or neutralizing the enemies of their clients”), and extraction (“acquiring the means of carrying out the first three activities—war making, state making, and protection”).
In a just world, only the third and fourth activities would be acceptable, and the fourth only voluntarily.