How do I make spells non-hostile?
In Morrowind magic effects themselves are marked as either offensive or non-offensive (to my knowledge, this part is hard-coded). When you cast any spell that puts an offensive effect on any actor other than the player, the actor's AI will regard that as being attacked.
For info about which spell effects are considered offensive, check their individual articles on UESP.