In the poem, the speaker talks about the soldier he killed. He begins by saying that, if they had met at some ancient inn, he would have shared many drinks with the man.
But, since they are both in the infantry and at opposing sides of the war, the speaker feels that he must act for the sake of self-preservation. In war, the enemy must be defeated. So, the speaker shoots at the other soldier. In the second stanza, we learn that the other soldier also shoots at the speaker.
Both men act instinctively and according to their training. We learn that the speaker ends up killing the other soldier. In the third stanza, the speaker experiences a pang of regret in causing the other man's death. He rationalizes his actions and maintains that he killed him for a good reason—the other soldier was his enemy.
Yet, this doesn't seem like a good explanation for a seemingly senseless execution. The speaker attempts to humanize the dead soldier. He imagines that the soldier enlisted for the same reasons he did. Perhaps, the soldier was out of work (just like he was) and may even have had to sell his belongings.
In the fifth and last stanza, the speaker laments the curious nature of war. It's because of war that a man must shoot another whom he would have otherwise treated to a drink or lent money to.