Spells are not structures of "wish-thinking", that is bland ignorance.
Despite that you associate it with superstition or Wicca, it isn't related to liberation. Of course, the Buddha didn't teach us magic of any kind, especially not sorcery. He didn't because it isn't the Way to the Cessation of Suffering.
However it is still a practical and real dimension of existence that is helpful to recognize, and for some people helpful to practice also. For others, still, there is a certain degree of necessity--or the alternative for them is to become a monk or nun, which is often much less practical.
Magic is simply a general term for one of the natural arts, a thing of phenomenological law that involves symbols, mechanisms of symbols, layers of these mechanisms, or sometimes just the implications of the symbols themselves causes these forces to work. It is a very fine mechanical art-form, and exponentially delicate. It isn't confined to spirits, to animals, or to being of others planes. Representing, organizing, connecting, associating, and patterning these symbols in certain constructs and in various formats is a firm method of employing various supernormal forces (this is not confined to spirits) to enact certain agendas.
It isn't wish-thinking, it is a scientific field that is so very delicate as to become more precise the further it is understood. It also has everything to do with the forces allowing the enabling of the magic. It certainly cannot be discredited by anyone who decides to call it something perverse in stead of acknowledging an obvious misunderstanding of its nature, calling it this or that derogatorily. But with all things of sacredness, there is either attentive inquisition or blind disfavor.
Sometimes no Buddhas arise in the world. Sometimes they do. When it happens, it is for the welfare and happiness of men, out of compassion for all creatures. For a long, long time he has been working to become a Buddha. He met other Buddhas along the way. And after his long striving he attains his final life, yet not without showing everyone else how to get there.