The answer to this begins in the Prologue where God says he is convinced Faust will always choose right regardless of Mephistopheles temptations. In fact, it is God who turns Mephistopheles' attention to Faust and lays the conditions for his wager with Mephistopheles (the first of two wagers in Faust):
God: Do you know, Faust?
Mephistopheles: The Doctor?
God: My servant, first! [...]
Though he’s still confused at how to serve me,
Mephistopheles: What do you wager?
Faust's transcendence begins immediately after losing Euphorion and Helen. Faust is left alone. Helen's garments evaporate to mist. On that mist, Faust is flying on a cloud over land and sea. When atop the mountains where the cloud deposits him, he turns his thoughts to helping mankind, to doing "what Men need," Faust refocuses Mephistopheles on a world-oriented vision: "That’s my desire, so be brave and promote it!"
Phorkyas (To Faust.)
[Keep the] Noble gift for yourself, and soar on high:
It will carry you quickly from the lowest
(Helen’s garments dissolve in mist, surround Faust, lift him into the air, and drift away with him.)
The old couple, Baucis and Philemon, allows a demonstration of how Faust is now transcended and separated from Mephistopheles, despite all that has gone before. The demonstration gives substance to Faust's reproach of Mephistopheles for destroying the cottage and the couple and to his yearning to let go of magic as expressed in his encounter with Care: "Take care: of magic spells show not a trace."
The couple's purpose is to demonstrate Faust's transcended state; to confirm his rejection of magic; to affirm his reconnection to living, thus rejecting the quest for ultimate knowledge; and to demonstrate Faust's final separation from and rejection of Mephistopheles.
Faust: If I could banish Sorcery from my track,
Unlearn the magic-spells that draw me back, 11405
And stand before you, Nature, as mere Man,
Their presence make Goethe's thematic point of redemption plausible. God wins the wager. Faust rejects evil and embraces good. Thus Gretchen's prayers for Faust may be granted and Faust snatched from the hands of demons even on the other side of death:
God: A good man, in his darkest yearning,
Is still aware of virtue’s ways.
Baucis and Philemon represent the point of where Faust can begin to achieve salvation. If Goethe does not include them, Faust's depravity can continue unabated. It is Baucis and Philemon that demonstrate how Faust's desire to appropriate the world in accordance to his own subjectivity is hollow if it is not rooted in something more transcendent than individual gain. In Baucis and Philemon, Faust becomes cognizant of his own capacity for evil and sparks a change in his being, a pivot towards salvation from the negation and condemnation that had been a part of his identity. Goethe's inclusion of Baucis and Philemon also serves to remind us that there is good in the world. Faust's own obsession with contingency and replacing transcendence with his own notion of self is not the only mode of being in consciousness. Baucis and Philemon and their transcendent love of what they believe is right reminds the reader, and eventually Faust, there there is good in this world and the presence of good in the modern setting, however small it might be, could very well be enough to trigger change in ensuring that the nature of our own being is reflective of this good both in the world and outside of it. In Baucis and Philemon, the divinity that is within human beings becomes painfully present to Faust, causing him to lose his sight and begin the process of his own salvation. This is not as likely without Baucis and Philemon.