The fact that this walk occurs on Halloween, in and of itself, is part of the setting that makes it scary. The evening is coming to a close. First, they must make their way past the Radley place which has already been a source of fear and intimidation over the summer. Even though Jem faced that fear, he did not escape his mission unscathed, so in their minds the place has become even more of a mystery, and mysteries mean potential threats. It is getting dark, and they are taking a path through the approaching gloom on a windy, moonless night when they are first frightened by Cecil. This is a typical childhood prank, one that is common on Halloween, but when you consider all of the other things that the kids have gone through this past summer as a result of the trial it is likely that their nerves are already a bit on edge. This entire walk, and the fact that the build-up to their fear leads only to Cecil Jacobs, is a means of setting the reader up for the truly scary journey - the walk home - when a perceived threat becomes a real one in short order.
There were several variables which made Jem and Scout's walk to the school a bit frightening. It was a dark night--"there was no moon" and "it was pitch black"--with no light to guide them on their way. The lone street light "cast sharp shadows on the Radley house," and they wondered aloud about Boo's whereabouts. It was windy and rain was expected. Jem recited a scary rhyme to put Scout more ill at ease. When Cecil Jacobs jumped out to scare them, it only added to the tension of the night.
Jem and Scout would normally have been accompanied by an adult, but Atticus and Aunt Alexandra decided not to attend, so Atticus entrusted Jem with escorting Scout.
At the beginning of this chapter, the kids are walking to school for the Halloween party. A few details about the walk over make it seem scary.
First of all, it's a bit scary because they have to go past the Radley house. Beyond that, though, there is the weather. The wind is blowing and there is no moon. That means that it will be dark and that there will be weird noises because of the wind in the trees and whistling through cracks and such. The streetlight is casting "sharp shadows." All of this stuff makes the setting seem a bit spooky.
On the way to the pageant, Scout and Jem are frightened by Cecil Jacobs, who has been lurking around them and eventually jumps out to scare them. This scene affects the reader later because on Jem and Scout’s trip home from the pageant they hear noises in the dark and believe Cecil Jacobs is giving them the same treatment. However, we later find out it is indeed not Cecil Jacobs. It is Bob Ewell, who has come to attack the two as vengeance for Atticus making him look like a fool during the trial.