Tom is full of superstitious rituals that revolve around marbles. First, he thinks that:
If you buried a marble with certain necessary incantations, and left it alone a fortnight, and then opened the place with the incantation he had just used, you would find that all the marbles you had ever lost had gathered themselves together there, meantime, no matter how widely they had been separated.
In other words, he believes that if he says certain spells over a buried marble, leaves it buried for two weeks (a fortnight) and then digs it back up again, it will have attracted all his other lost marbles to it, no matter how far away they are.
Tom is astonished when this doesn't work. He digs up the original marble, and lo and behold, he finds only the original marble. We are told by the drily amused narrator that:
Tom’s whole structure of faith was shaken to its foundations.
Shaken, but still hopeful, Tom consults with a doodle-bug to find out what interfered with his spell. He interprets the doodle-bug to be telling him that witches interfered. In other words, it wasn't that his spell was proven false, but that a stronger force intervened.
This is an example of confirmation bias. Tom is going to believe what he believes, no matter how much the evidence shows he is wrong.