Mary Shelley's Frankenstein is a frame narrative. Walton's letters are...
...the frame around which the novel is based.
These letters to his sister serve several purposes. First, the author does not give away the story's ending. If Victor began the story, how would the reader ever learn of his fate? He would be unable to tell the end of the tale (after he dies) unless his story was interrupted at his death, and Walton was somehow able to step in and share the news of Victor's death. This would have been particularly awkward.
Walton is able to share with his sister (and us) not only Victor's story and the creature's version of the story (as told to Victor), but also what occurs with the creature after Victor is dead—an aspect of the story that conveys an important element: the "monster's" abject remorse and grief at his creator's passing.
...a tale told in folklore, to warn its hearer of a danger.
An allegory is...
... narrative form in which the characters are representative of some larger humanistic trait...and attempt to convey some larger lesson or meaning to life.
In this story, the allegory is theme-based, sharing a life-truth with the audience. Victor's downfall comes with his quest for dangerous or forbidden knowledge: his desire to create life, like God.
It is a cautionary tale involving Walton because he is also pursuing that which he should not—"[a wish] to conquer the unknown"—just as Victor did—without thought to the consequences of his actions. Walton is exploring unknown areas of the North Pole. When Victor is rescued by Walton's crew, he describes the dangers of trying to rise above the natural order by creating the creature without thought to his responsibilities or the outcomes of his experiments, and doing something man was not meant to do: creating life. At the same time, Walton (a parallel to Victor's character) is ready to continue to pursue his dream at the cost of other men's lives: he is so blinded by ambition that he loses sight of his moral obligations—just like Victor. Hearing Frankenstein's tale, and then seeing the sorrow of the creature, Walton learns an important lesson, and stops before disaster strikes. Victor delivers the Shelley's message:
Seek happiness in tranquility and avoid ambition, even if it be only the apparently innocent one of distinguishing yourself in science and discoveries.
Lastly, because Walton is simply hearing the tale, he is a more credible storyteller. E.g., Victor accuses the creature of being a monster. The creature believes Victor was equally monstrous in creating, abandoning and rejecting him. Walton is not personally involved in Victor's life: he has emotional distance, and is touched by the creature's words:
Some years ago...when I felt the cheering warmth of summer, and heard the rustling of the leaves and the warbling of the birds...I should have wept to die...
You...seem to have a knowledge of my crimes and his misfortunes. But in the detail which he gave you of them he could not sum up the hours and months of misery which I endured...
Victor could only see things from his perspective. The creature notes that even Lucifer had friends—but he is totally alone in the world.
Walton is an important part of the telling of the story.
The letters are used to present the sister in a place "we know", while the letters pull you into the world where Frankenstein and Walton are.