Every time I read a fantasy book, there’s a snake. Either they reference Ouroboros, Quetzlcoatl, or the Rainbow Serpent, or it’s used in some kind of ritual, or it’s a familiar. Okay, not literally every fantasy book, but a lot of them.
Well, I think a good part of it comes from the fact that Christianity is so huge all over the planet. Historically, there’s an anti-Christian stigma against witchcraft and magic (unless it’s not directly caused by some acceptable part of Christianity—then it’s called a miracle) and an anti-Christian stigma against snakes (that whole Garden of Eden thing and all). So there, already, you have this inextricable link.
(Note: I’m not saying anything against Christianity, here. But Satan took the form of a snake when he convinced Eve to commit the original sin, and there’s that whole Salem Witch Trial thing in support of a historical hatred for witchcraft. Just the facts, y’all.)
But it’s not just the Christian sub-culture. Go back to Quetzlcoatl. The winged serpent, and one of the main Aztec gods. The caduceus, used by Hermes to help lead the dead to Hades, was a pair of intertwined snakes. Snakes appear in mythos all over the world: Nordic, Egyptian, Hinduism. Deities. Spirits. Mythical creatures. All different kinds of magical things, things that play into fantasy. And, whether we know it or not, we’re all pulling from the world zeitgeist. Only so many things, and it seems that a lot of them have snakes, doesn’t it?