Lewis Milestone began his film career in the silent era, and the ending of All Quiet on the Western Front shows his mastery of that form. Without expending a word, Milestone says all he needs to say about the effects of war.
A Dead Man's Tale
Before we discuss what is up with the ending, let's break it down:
After Kat's death, Paul returns to the trenches, visibly depressed at having lost a true friend. Looking beyond his gunner's nest, Paul spies a butterfly just out of reach. Despite knowing better, Paul exposes himself trying to reach the butterfly and is shot by a French sniper. He dies off-screen. We only see his hand flinch at the shot and then lie still in the mud.
The ending is a summation of what the movie has been saying its entire runtime: war isn't glorious—it destroys and kills.
Butterfly in the Sky
The inclusion of the butterfly is original to the film. What it symbolizes and why Paul exposes himself to reach for it is left open for the viewer to interpret. We know, however, that Paul collected butterflies as a child, since he and his sister reminisce fondly over his collection at home:
PAUL: I remember when you caught that [butterfly].
ANNA: Yes. And you took it away from me, didn't you?
PAUL: Yes, I did.
But that's all the information we get to connect Paul with the imagery of the butterfly, and it leaves the viewer a lot of interpretive blank space to get creative with.
For example, the butterfly could symbolize the home Paul remembers, and his reaching for it an attempt to reconnect with the world he left behind for the Front. Or could the butterfly simply represent Paul's attempt to obtain something beautiful in his life again, beyond the muck and mire of the trenches.
Then again, maybe the butterfly represents metamorphosis and Paul's reaching for it symbolizes his desire to change himself. Remember when Himmelstoss said, "You're going to be soldiers, and that's all!"? Maybe Paul's trying to change into something more than the soldier the war has required him to become.
The final scene of the film returns to an earlier scene when the boys were marching to the front to string barbed wire. This time, the image is superimposed over a shot of a graveyard.
The boy's march parallels the film's opening, when the soldiers were gallantly marching through town. This time though, there are no crowds cheering, no swelling music, and no sense of national pride. Only silence hangs over the boys' ghostly images as they march toward their own deaths.
This final image subverts Kantorek's lecture from the film's beginning:
KANTOREK: I believe it will be a quick war, that there will be few losses. But if losses there must be, then let us remember the Latin phrase, which must have come to the lips of many a Roman when he stood embattled in a foreign land, Dulce et decorum est pro patria mori. Sweet and fitting it is to die for the fatherland.
Now that we've reached the end of the story, we know the losses weren't few and no fancypants Latin phrase seems fitting enough to compensate. Clearly it's neither sweeter nor fitting for young men to die.