Kirsch's mind is kind of blown by finding this sort of thing in the Talmud, although he does his best to accommodate it:
The ease with which magic and witchcraft find a place in the Talmudic worldview is, to my mind, both illuminating and compromising. For it suggests that the Talmud’s general commitment to exact measurement and correct action—the need to find out exactly how to behave in order to please God, down to the order in which you put on your shoes in the morning—is itself a kind of magical thinking.Acceptance of the idea of the demonic (and angelic) supernatural is the norm for human societies and it is ours that is out of step with the rest of humanity. Not that we don't have good reason, but that supernatural idea does find a place for subterranean and often dark aspects of the human mind and gives them a coherent place in human society. There is a vast anthropological literature on this: off the top of my head, I. M. Lewis, Ecstatic Religion: An Anthropological Study of Spirit Possession and Shamanism (Harmondsworth, England: Penguin, 1971), comes to mind as an old classic.
For the rabbis, Jews are the protagonists of a cosmic drama in which their every slightest action will be either rewarded or punished. There is something ennobling about this, but when the same kind of scrutiny is attributed not just to God but to demons and witches, it begins to seem oppressive and even absurd. What’s more, it impugns the authority of the rabbis themselves. If we have to listen to the Sages when they tell us about the 39 melachot of Shabbat, aren’t we just as bound to listen to them when they tell us that a “sorb tree that is close to the city contains no less than 60 demons?” And if they are wrong about the demons, mightn’t they also be wrong about the melachot?
It's not as though these aspects of human consciousness can be ignored. They will get our attention one way or another and I am far from convinced that replacing the old supernatural paradigm with some widely used modern ones, notably Freudian Psychoanalysis, represents much of an advance. On the latter, see Karl Popper's critique, which can be found, for example, summarized by Bryan Magee in Popper (Modern Masters; London: Fontana, 1973), chapter 3.
Earlier Daf Yomi columns are noted here and links.