In order to fully grasp what's going on with the ending to The Flies, as well as what's happening in the rest of the play, it's important to understand something of Sartre's theory of radical freedom. For more on freedom, check out Orestes's "Character Analysis."
The Flies creates a pattern of choice/action pairs. In Act II, for example, Orestes chooses to commit himself to freeing the Argives and then acts in accordance with this choice. In Act III, he debates with Zeus at length about the nature of freedom and the consciousness of man. We fully expect that, at the end of the act, he will act in accordance with these beliefs.
In some ways, he does. After begging Electra to ignore the furies and step away from the protection of Apollo, he takes his own advice and does so himself. After insisting to Zeus that god has no power over man, he blatantly ignores the god's commands. After flaunting his ability to walk free in the sunlight (see "Symbols, Imagery, Allegory" for details), this is exactly how he ends the play.
One of the confusing parts of the ending is that the furies chase after Orestes. We have to wonder why it is Orestes who is chased by the furies and not another character. Didn't Orestes make a big deal out of his freedom? Didn't he tell Electra that the furies have no power over those who are free? How is it that Electra is free from the wrath of the furies while Orestes, in The Flies and according to legend, is haunted by them forever?
We can look at this issue in three different ways. First of all, just because the furies don't chase Electra doesn't mean she is free from their wrath. We know that she's committed herself to a life of remorse, which means the goddesses of remorse are with her forever, even if the literal furies aren't physically beside her.
Second, remember that freedom, according to Sartre, is the ability to interpret and assign value as we choose. Zeus may send the furies after Orestes, but it is up to Orestes to interpret what this means and how it will effect him. If he chooses to ignore the furies, they might as well not be there at all. And it certainly doesn't mean that they're torturing him just because they're trying to torture him.
Finally, look to Orestes's metaphor of the Piped Piper of Hamelin in the final passage of the play. Just as the Pied Piper freed the village of its rats, so Orestes frees Argos of its flies (remember from "Symbols, Imagery, Allegory" that the furies are just meaner versions of the flies). "Fear your dead no longer," he says; "they are my dead. And, see, your faithful flies have left you and come to me" (3.1.18). Orestes has to take the furies with him in order to rid the citizens of Argos from their grasp.
Of course, given what we learn from Electra – that guilt is self-inflicted and that the physical presence of the goddesses of remorse isn't necessary for torment – this isn't exactly a comforting thought. Just because the furies have left town doesn't mean the Argives are free. Whether or not Orestes has succeeded in his task to free the citizens of Argos is by no means clear. It's up for debate.