This is a great topic and one, as a struggling author, have wondered about, myself.
I think one place to draw some inspiration from is the example of Dean Koontz, who is a practicing Catholic and does nothing to glorify evil of any sort in his works and instead explores/promotes themes of goodness and the ability of good to prevail over evil. This is important to me, as I tend to feel most comfortable writing in the horror/thriller genre and don’t want to engage in writing which creates a sense of despair. An opposite example is the writing of Steven King, for example, which is often pervaded with a sense of darkness and lost hope, in spite of the window dressing of “good” – the ending of The Stand, even though it is pitched as a victory of good over evil, really changes nothing and evil still endures.
Brother Odd, for example, was one of the best treatments of Catholicism in popular literature I’ve run across. Personally, when I sit down to write, I usually pray that what I write will be to the service of God and not to anything else, and I’ve been struck with surprise at how fast and easily the words come when I do that.
As far as the issue of magic and fantasy as a whole goes, I think it depends very much on the person who is experiencing it. Vin Diesel, talking about his teenage experiences with Dungeons and Dragons mentioned that it was somewhat of a reflective mirror, a tool of self-exploration. If anything, I think this is very accurate – when I played D&D in the past or computer RPGs these days, I have always picked a paladin as a character of choice. I have known people who have picked “chaotic evil” types to play, but this also seems to reflect a frustrated desire for power or grandiosity that they will never experience in their personal lives. (instead of being humble enough to understand that God loves us all, but we’re not God) Therefore, the game itself became a way to project one’s personal views and attitudes, as well as to act out what can’t necessarily be done in real life, in essence a very neutral endeavor which becomes what you make of it.
Translating this into fantasy literature, I think it’s a two part process of the creation of the fiction and the interpretation, construction of the fiction in the mind. People, within reason, will get what they want out of the work if it’s there to have. So, a work which emphasizes the victory of good over evil, and the wielding of power by entities which are clearly not human, such as Lord of the Rings, is probably not going to appeal much to a person who is of an occult/evil mindset and desires to find things which will validate their views. On the other hand, a work which lacks any kind of moral clarity will probably give people who’re morally ambiguous some role models or behaviors which they can identify with. The danger comes from works which are well-written, but contain very sympathetic portrayals of characters that are anti-heroes or morally problematic in their actions, such as Tyrion Lannister in the Song of Fire and Ice series. If it happens that these characters use magic, then people may naturally feel the urge to look for other ways to form connections to the growing archetype in their mind.
I think you can satisfy your conscience, serve God and still keep writing fantasy simply by making sure your villains are not portrayed as likable, sympathetic in spite of their evil, victorious, etc. If your characters do use magic, I think the treatment of it by having obstacles in use, a price that goes with it, things which do not make it seem necessarily wondrous, are good notions to have.