Radagast III: knitting together the story strands
The purpose is to unite the two separate strands of the movie, the quest of Erebor and the return of Sauron, and it goes back to Tolkien himself.
After finishing LOTR, Tolkien was faced with a vexing plot question: if Gandalf had been sent to Middle-earth to be the enemy of Sauron, why had he invested so much time and energy to helping the dwarves recover their kingdom and treasure? The answer must have come easily. Years earlier Tolkien had written the tale of the destruction of the elven refuge Nargothrond by the dragon Glaurung, who frankly makes Smaug look as threatening as a third-grader. (If you’ve not read The Children of Húrin, stop and do so now. I’ll wait.)
At the start of the movie, Gandalf no longer has this rationale consciously, but it is completely within the spirit of Tolkien to give him a foresight that he should aid Thorin, just as in “The Quest of Erebor” he has a foresight that Bilbo must join the company. And then along the way, the reason for his foresight is discovered. When that happens, the response to Sauron’s threat becomes twofold, as it is in the books: attack Dol Guldur and drive Sauron from Mirkwood, and complete the quest of Erebor to remove Smaug as a potential weapon.
While it would seem obvious to Tolkien that even a creature as intelligent and self-willed as a dragon could be used in such a fashion by a Dark Power, it wouldn’t seem anywhere as evident to film audiences who know nothing of the Glaurung story. So that’s why Jackson has the stone-giants attack Gandalf and his party, and giant spiders destroy Rhosgobel. It’s not just that it gives Gandalf the chilling insight that if Sauron has indeed returned, he is very likely planning to use Smaug in a similar fashion as a weapon against Rivendell. It’s that it makes this credible to the other members of the Council—and to us.
At the end of the tale, though, he will tell the rest of the Council that he’s had enough of dwarves and elves and men, and wants to devote his energy in any upcoming battle against Sauron to the protection of animals: someone has to look out for them. (And in a late note, Tolkien imagined that he was sent to Middle-earth by the Vala Yavanna for just that purpose, contradicting the statement in his essay on the Istari in Unfinished Tales that he had failed in his mission by doing so.) By this time, we will understand that the moth in LOTR was his messenger. Radagast is thus given an explicit presence in the other trilogy at the same time that his absence from it is explained.