Shortly before the film's final sequence—a battle to the death between Commodus and Maximus in the arena—Commodus visits Maximus beneath the Colosseum. He stabs him in the back (yes, literally) and then orders Quintus to cover up the wound.
But despite Commodus' treachery, Maximus still wins. He, however, dies in the process.
Not only is the audience finally given what they've been waiting for the entire film—Commodus' death at the hands of Maximus—but we also see Rome restored to proper leadership.
Throughout the film, various characters (Maximus, Lucilla, Gracchus, Marcus Aurelius) have talked about restoring republican government, and Maximus is finally, at the end, able to carry out Marcus Aurelius' dying wish: that Rome be made a republic again.
Maximus' heroic death not only avenges the death of his family and of Marcus Aurelius, but it also frees Lucilla from her brother's tyranny, and Rome of an evil, despotic tyrant. As Lucilla makes clear, Maximus' death is, in a lot of ways, a sacrifice for Rome:
LUCILLA: Is Rome worth the life of one good man? We believed it once. Make us believe it again. He was a soldier of Rome. Honor him.
Maximus' heroic death, and the ensuing funeral procession (Lucius, Quintus, Gracchus, and others all participate in carrying his body out) mark his complete and total resurrection, both into the afterlife and to the rank he held before the events of the film (a general in the Roman army).
The messages are clear: good triumphs over evil, non-cheaters triumph over cheaters, and good government will eventually vanquish tyranny.
The other important thing about the ending is the way in which the film attempts to guide our reaction to it. When the funeral procession carries Maximus out of the arena, all of the people in the stands of the Colosseum rise and silently observe. That, in some ways, is our reaction to the film's final sequence, and a model of how we should respond: quietly, and reverently.
It's hard not to be moved by the bittersweet end of Maximus' life, and yet when the camera pans up, and see a glorious, sun-lit image of Rome, it's hard not to feel that all is right in the world.