I was involved in a conversation several weeks ago about the fiction of Tolkien, Lewis, and Rowling and the theological-ethical frameworks that those authors apply to their characters' use of magic. One viewpoint among the participants was that Tolkien and Lewis have clear criteria for when the use of magic is evil, and Lewis has a complete theological framework. Tolkien argues that magic is perfectly appropriate for beings created with it as part of their natural abilities. In their case, it's not actually supernatural, because it's part of their innate capacities. As long as they keep the use of such abilities within their proper limits and in the appropriate circumstances for the right motivations (as with any natural ability or function), there's nothing wrong with it. Lewis clearly disapproves of Lucy's use of magic to overhear what her friends are saying about her and her desire to change her looks with magic. (This was one of the most disappointing things about the third Narnia film, which completely misunderstood that scene and left out both in exchange for a different misuse of magic.)
I didn't agree with all the details of how this was presented, but the basic thesis struck me as correct. But then came the claims that J.K. Rowling's treatment of magic is very different. There are some differences in the magic of her world, but they are incidental to this issue. The claim that struck me as most difficult to support was that she treats magic as casual, ordinary, and mundane, and there's no sense of the serious import of magic with dire consequences if it's misused. In responding to that, I realized that it was probably worth writing up a more careful presentation of why her treatment of magic is nothing like that.
First of all, one of the early distinctions we learn in the Potter books is between curses and charms. Curses are never intrinsically good, and when she presents them as morally permissible it's only because a greater good is at stake. They aren't intrinsically good, just like violence, but some of them can be used in certain contexts, perhaps, to achieve a good purpose. The same restrictions would apply as with violence in the real world, and any arguments against the of use of curses would parallel those pacifists make against using violence. Snape takes Harry to task for using Sectumsempra on Harry, but he's willing to use a nasty curse (but notably not one that would kill) against George Weasley as part of his masquerade as a Death Eater. There's no question that she distinguishes between good and bad use of magic, and it's not hard to see much of what she's doing as an analogy for technology in the real world. The ethics of magic is a major part of her series.
Even on relatively small-scale misuses of magic (meaning not Death Eater level but just things Harry and his friends do that seem fun), there's a lot of moral reflection going on. Take love potions as an example. Rowling is pretty clear that love potions don't actually produce love, just an intense infatuation. She distinguishes that from genuine love. We see the consequences of love potions most clearly in the case of Voldemort's parents, but a love potion also has serious consequences for Harry and Ron in the sixth book. We also receive a number of serious warnings from Professor Slughorn about the Felix Felicis potion, which Harry does put to great use at the end of book 6, but it helps him mostly in ways he doesn't recognize at the time, and Slughorn's cautionary urgings demonstrate mature reflection on important moral principles, and we see tight regulations on its use (e.g. the restrictions on its use in Quidditch). We encounter severe warnings about splinching from apparition (called apparation in its earlier appearances in the series), and becoming an Animagus is so dangerous that it requires registration with the government. The warnings in the third book about the dangers of time travel require a metaphysically-impossible theory of time, but the moral considerations brought to be there show that Rowling certainly has a moral framework at work to evaluate the use of magic.
The true horror of dark magic is front and center from book 4 on. You have the unforgivable curses. She seems to be tolerant of the use of the Imperius curse for a greater good (she certainly has Harry thinking so), but she doesn't seem to take the other two unforgivable curses to be ever all right (except for Snape's use of the killing curse on the already-dying Dumbledore to continue his masquerade as a double agent and to prevent Malfoy from doing so and harming himself in the process). You can't even use the Cruciatus curse without deeply evil intentions. Harry tried and failed. Harry's killing blows almost always come from redirecting evil characters' curses back at them (something the Death Eaters consistently make fun of him for). The depth of evil required for making horcruxes is vividly portrayed both in what Voldemort comes to look like as he's been losing pieces of his soul and by what he appears like in the afterlife-like scene in King's Cross toward the end of the final book. He destroys himself by using magic in this way.
Then there's the moral evaluation of the Deathly Hallows. It's clear by the end of the book that Rowling wants us to see the invisibility cloak as the only Hallow of continuing value to Harry. The elder wand is most appropriately acquired and used by someone who never wanted it. The resurrection stone is most appropriately used so Harry could get moral support in his preparation for giving up his life, not holding on to it. He ends up leaving it out in the forest where it had fallen. There's a clear sense of the illegitimacy of trying to hold on to your loved ones who have died, and the idea of acquiring power just to have more power leads her to write of the elder wand's history with one owner after another, each losing their prize and their life from the continued pursuit and acquisition of the wand by the next possessor. Harry uses it to repair his broken wand and then buries it with Dumbledore.
Rowling's "deep magic" based on love, a magic Voldemort never understands, is a clear tribute to Lewis. A voluntary sacrifice on behalf of someone else provides magical protection. She has Harry protected from Voldemort's magic in this way in his very body, until Voldemort takes Harry's blood into himself in a perverse use of magic that comes to backfire on him (because he in effect made himself serve as something like a horcrux for Harry, preventing Harry from dying when he finally could deliver a killing curse to Harry, which in the end only destroyed the scar that served as a horcrux for Voldemort. But Harry's mother's sacrifice continued in an extended way in the protection of the home of Harry's mother's sister as long as he officially lived there, and Harry's own voluntary sacrifice on behalf of all those who opposed Voldemort, together with the fact that he was using a wand whose loyalty was to Harry, ended up preventing his curses from doing anything after he and Harry returned to the world of the living from the King's Cross scene.
The contrast between these kinds of magic is one of Rowling's major themes, and the idea that she has nothing of a theological-ethical framework for the use of magic just flies in the face of all the work she does to present exactly such a framework. It's true that she's nowhere near as theological as either Lewis or Tolkien, but you have to have a pretty superficial reading (if you read the books at all) to suggest that she's treating magic is purely mundane, with no serious consequences, no sense of when it might be misused. There's quite a lot of reflection in her series about the ethics of magic, and her reflections strike me as thoughtful and morally mature, with few exceptions.