In part I of Notes from Underground, the underground man gives us some backstory from his career as a spiteful government official. He says, "I was a spiteful official. I was rude and took pleasure in being so."
He specifically mentions the officer, pointing out his clanking sword:
...[O]f the uppish ones there was one officer in particular I could not endure. He simply would not be humble, and clanked his sword in a disgusting way. I carried on a feud with him for eighteen months over that sword. At last I got the better of him. He left off clanking it.
Later, he retracts his spitefulness:
I was lying when I said just now that I was a spiteful official. I was lying from spite. I was simply amusing myself with the petitioners and with the officer, and in reality I never could become spiteful. I was conscious every moment in myself of many, very many elements absolutely opposite to that.
Then, he admits:
I bet you think I am writing all this from affectation, to be witty at the expense of men of action; and what is more, that from ill-bred affectation, I am clanking a sword like my officer. But, gentlemen, whoever can pride himself on his diseases and even swagger over them?
Isn't it ironic that the underground man is being spiteful of the spiteful? That he is clanking his sword at the sword-clanker? That he is spiteful of men of action, but he is--at times--a man of action? Certainly, the underground man is conscious of his pride and hyper-criticalness. After all, he says we are all diseased like him, forever split between action and passivity, between spitefulness and victimization, and between hatred of others and self-loathing. This is the modern consciousness, a mindset of existential back-and-forths that is torn between reason and emotion.
Here, the underground man is writing a polemic against officers and himself. He hates spiteful people, yet he is one! Instead of using brash outward attacks against others, he uses this diary as a internal attack. Instead of physical swords, he uses words as weapons. His polemic is his sword, and it clanks a lot. He is very much treating his reader the way he treated the officer 20 years ago. As such, the officer is a proxy for the reader: those whom the underground man cannot stand. They are the self-important, the hypocrites, the self-righteous, the luke-warm Christians, the materialists, and the snobs.