It seems like, whenever a pop culture phenomenon involves magic, there are fundamentalists complaining that it’s evil. Strange, because I’ve never seen any evidence of people actually working the spells in Harry Potter or Dungeons & Dragons, whether for good or bad. But then, if you’re going to take Bible stories like Exodus at face value, you pretty much have to believe magic works, or at least did at some point in history. When Moses turns his rod into a snake, the Pharaoh’s magicians are able to do the same thing. Moses’ snake eats the others, proving that his magic is better, but that doesn’t mean the presumably pagan magicians’ was ineffective.
The prophets are constantly working magic, but it’s with God’s consent, and often at his orders. I’ve seen it proposed that the reason the Jews condemned witchcraft was that it was more or less trying to boss God around.
I’m not sure when the idea developed that people can learn magic through bargains with the Devil, but it seems to have become the default belief for the anti-fantasy fundamentalists. And deals with Satan never end up working out all that well for mortals.
Harry Potter actually contains a lot of Christian themes, but the magic doesn’t appear to be inherently for or against God. Even Voldemort just splits his soul into pieces rather than selling it to a demon. And Harry uses an Unforgivable Curse at one point, which I found…well, unforgivable. There’s no indication that it affected him in the long run, though. One reason I bring this up is that a central theme of The Lord of the Rings is that the Ring itself is a distinctly evil talisman, directly linked with a devilish being. It’s introduced in The Hobbit as simply a typical magical item, bestowing invisibility when worn. In the sequel, however, it turns out that extended use or even possession of it will have a corrupting influence, and that Sauron is able to manipulate its bearers to his ends.
Of course, not all magic in J.R.R. Tolkien’s books is like this, but there does seem to be a general warning here of magic use having a dire cost.
Many fantasy universes, and even some people who believe they can use magic in real life, differentiate between black and white magic, and sometimes certain kinds of magic bear curses.
I’m sure I’ve noted before that, in the Oz series, magic tends to be morally neutral. It’s the magic-workers who utilize it for good or evil ends. That’s not to say that Ozian magic never takes its toll on its users. It’s hinted that the reason the Wicked Witches of the East and West are so withered and dried up is that they used magic to expand their lifespans.
The Witch of the East dries up into dust in the sun after Dorothy’s house lands on her, and the Witch of the West is dissolved by water. It’s also mentioned that the latter no longer has any blood, as it had all dried up long ago. In addition, she and Blinkie each have one missing eye.
Even Queen Zixi of Ix sees herself as an old hag in a mirror despite remaining young in outward appearance, although it doesn’t appear to affect her physical abilities. Are these indications that they messed around with dark forces beyond their control, however, or simply side effects? It’s interesting that L. Frank Baum seemed to regard radium as a miraculous substance, when it was discovered after his lifetime that it could cause cancer. I don’t know that even the magic-hating fundamentalists think radium is possessed by Satan, however.