This phrase is used to describe the dreadful appearance of a young soldier who has inhaled some kind of poison gas and is now dying, slowly and painfully. He did not get his gas mask on in time, and so, in the second stanza of the poem, the speaker describes him as having an extreme physical reaction to inhaling the poison. This is a slow death, while the poison burns his lungs from the inside and they fill up with fluid and blood.
Unwilling to leave him to die alone on the battlefield, this poor soldier’s comrades have “flung him” into the back of the wagon, and he lies here, dying. It is, it seems, a very painful and torturous death, as the word “writhe” means to twist or contort out of shape; it is not a word with a positive connotation, as it most often implies pain or, at the very least, discomfort. The man’s lungs, now “froth-corrupted,” would be excruciating, and he would struggle to breathe, and this combination of pain and breathlessness would likely force his eyes to seem to roll around in his head. Perhaps, for the most part, only the whites of his eyes are visible because the irises keep dipping below the surface of his skin. This is a very vivid visual image that helps us to understand the pain he’s in, that this is not a “sweet” or “becoming” death as the Roman poet Horace, author of the original Dulce et decorum est pro patria mori phrase, would suggest.