Ralph and the naval officer are representing the same ultimate goal: a desire for order—maybe at any cost.
When he first arrives and inspects the scene, the officer's demeanor is worth noting:
The officer looked at Ralph doubtfully for a moment, then took his hand away from the butt of the revolver.
Although he's encountered a group of skinny, dirty, scared kids, his first instinct is to go for his gun: order at any cost. And that is just what Ralph has faced on the island. Although he tries to explain that he made attempts to organize the boys better at first, he cannot express himself to this man. After Ralph lost control of his group, they became savages, literally murdering each other in a bloodthirsty display that captured the lack of reason and order that Jack created. On the island, violence came from a lack of law, and here is a man who is bringing potential violence with him in order to restore law and order to the group.
Note that in the final line, he is "allowing his eyes to rest on the trim cruiser in the distance." The comparison of violence as a result of no order and violence that is sometimes done in the name of order is striking.