Dill said this because he was fascinated with Boo Radley and wanted to see his house.
The children barter in books. They use these books to entertain themselves, acting out the stories together throughout the summer. The books symbolize imaginary fear.
Our first raid came to pass only because Dill bet Jem The Gray Ghost against two Tom Swifts that Jem wouldn't get any farther than the Radley gate. (ch 1)
Scout comments that “in all his life, Jem had never declined a dare” (ch 1)
The book is also mentioned at the very end, taking us full circle.
"Read it out loud, please, Atticus. It's real scary." (ch 31)
Atticus says they have had enough scary already. He is referring to Boo Radley saving the Finch children from Bob Ewell. The fear was real, and the books were no longer needed. The children moved on to an adult view of reality.
"Jem stood in thought so long that Dill made a mild concession: "I won't say you ran out on a dare an' I'll swap you The Gray Ghost if you just go up and touch the house."
Jem brightened. "Touch the house, that all?"