Boo serves a couple of purposes within Harper Lee's novel. It's possible that someone might think that Boo doesn't actually serve much purpose until the very end of the book, but that would be incorrect. He does, for sure, serve a huge plot purpose at the end of the novel. Bob Ewell attacks both Scout and Jem one night on their way home from a school event. Boo Radley rushes to their assistance, saves them, and in the process he kills Bob Ewell. Without Boo, it's likely that Scout and/or Jem may have been killed.
Earlier in the novel, Boo serves as the stereotypical "weird neighborhood guy." I had one growing up. I'm sure most people did too. That's what makes Boo and his house so relatable. At first Boo and his house serve as place to avoid because of all of the weird stories about it and him. Then Scout, Jem, and Dill decide that it's necessary to contact Boo and perhaps have ice cream with him.
"Dill said, “We’re askin‘ him real politely to come out sometimes, and tell us what he does in there—we said we wouldn’t hurt him and we’d buy him an ice cream.”
Through Atticus's continued mentoring, Scout and Jem come to realize that Boo isn't a monster, but a man. A reclusive man, but a man none the less. From there a friendship of sort develops between Boo and the kids. None of it is face to face. It's little gifts left in the knot hole of the tree.
In the final chapter, Boo helps Scout take a final step into growing up and realizing that she can't judge people simply by stories and/or surface level observations. She has finally learned Atticus's message of walking around in someone else's shoes. She feels guilt about her initial impression of Boo and finally let's that go as she stands with Boo at his house.
"Atticus was right. One time he said you never really know a man until you stand in his shoes and walk around in them. Just standing on the Radley porch was enough."