In Harper Lee's To Kill a Mockingbird, the author has established a strong connection between the Finch children and Boo Radley. More accurately, Boo has become an obsession to the children as they never see him, and much of what they know is based on outrageous lies and unkind gossip. For instance, the idea that Boo captures and eats squirrels is the product of someone's malicious imagination or grotesque sense of humor.
When the gum first attracts Scout's attention as she passes the tree, she doesn't think too much about it, and child-like, she eats it—no questions asked. Jem is frightened that it might be poisoned and makes Scout spit it out (it had lost most of the flavor anyhow, Scout admits) and gargle. However, as time goes on, more and more items find their way into that tree. There are very old Indian head pennies, a ball of grey twine, a medal for something like a spelling competition, carved soap figurines that look a lot like Scout and Jem, and even a broken watch on a chain, among other things.
The tree becomes a source of wonder for the children. They decide to leave a note inside the knothole to the person that is leaving the gifts. When they go to the tree on their way to school to do so, the tree's knothole has been filled in. Scout is tempted to cry, but Jem comforts her—though by his pale face, we know he is shocked as well. The next day, Jem asks Mr. Radley why it has been cemented closed.
Tree's dying. You plug 'em with cement when they're sick. You ought to know that, Jem.
Jem and Scout take this information to Atticus, who though he feels the tree looks healthy enough, diplomatically asserts that Mr. Radley knows his trees better than anyone else. However, maybe Mr. Radley is lying.
As the reader, we may only have a suspicion of who has been leaving the gifts. That Mr. Radley fills the hole makes us further suspicious that it could be Boo—this along with the fact that the gifts are like those of someone reaching out in friendship, and the soap statues indicate it's someone who know what they look like: there are not too many other people to choose from. (By Chapter Eight, we know that Boo goes out at night.)
The question remains as to why the hole is filled with cement. Mr. Radley says the tree is sick, but Atticus (who never lies to Jem and Scout) tell the kids it looks healthy to him. I do not believe the hole is filled as a slight to Jem and Scout. However, from what we know of Boo's past at the hands of his father when he was younger, it is not hard to believe that Mr. Radley does this to punish Boo. When Arthur Radley, a typical teen, gets in trouble with the law on minor charges, his father takes it very seriously. We know that Boo is left at the jail until Mr. Radley is told he must take him home. Though rumors abound, the only thing that his certain is that Boo goes home and is never seen again: he does not come out of the house, and it has been many years since this happened.
By filling the hole, Mr. Radley continues treating Boo as he was treated when he first got in trouble. He is separated from the company of other people—from the outside world. His gifts—if we believe they are his—are a way for Boo to connect to the children. Closing the hole isolates Boo yet again for the minor infraction—an error in judgment—of his youth. This is why, I assume, Mr. Radley fills in the hole.