The answer seems simple enough: The Torah itself references witchcraft during the story of the Exodus, when Pharaoh's magicians mimicked Moses' supernatural signs and several of the plagues. And a number of verses in the Torah prohibit magic and sorcery: "You shall not allow a sorceress to live" ; and "There shall not be found among you . . . a soothsayer, a diviner of [auspicious] times, one who interprets omens, or a sorcerer, or a charmer, a pithom sorcerer, a yido'a sorcerer, or a necromancer. For whoever does these things is an abomination to the L‑rd . . ."
So seemingly, the Torah does believe in the concept of magic and witchcraft—for otherwise, there would be no need to prohibit it.
Indeed, the majority of Torah authorities seem to be of the opinion that magic does in fact exist. Maimonides, however, seems to disagree. Let's explore the philosophical underpinnings behind this disagreement.
Maimonides on Witchcraft
After explaining the punishment for "performing" magic, Maimonides goes on to explains that, in truth, there is nothing to it:
All the above matters are falsehood and lies with which the original idolaters deceived the gentile nations in order to lead them after them. It is not fitting for the Jews who are wise sages to be drawn into such emptiness, nor to consider that they have any value . . . Whoever believes in [occult arts] of this nature and, in his heart, thinks that they are true and words of wisdom, but are forbidden by the Torah, is foolish and feeble-minded . . . The masters of wisdom and those of perfect knowledge know with clear proof that all these crafts which the Torah forbade are not reflections of wisdom, but rather, emptiness and vanity which attracted the feeble-minded and caused them to abandon all the paths of truth. For these reasons, when the Torah warned against all these empty matters, it advised: "Be of perfect faith with God, your Lord."
In Maimonides's view, magic and sorcery is prohibited precisely because it is all "emptiness and vanity." Instances of magic in the Bible were really tricks and illusions.
Magic and the Unity of G‑d
Others, most notably Nachmanides (Rabbi Moshe ben Nachman), are of the opposite opinion that it is prohibited precisely because it works:
And now, know and understand regarding magic, that the Creator (may He be blessed) created everything from nothing and made the upper realms the guides of what is beneath them; and He placed the power of the earth and all that is in it in the stars and constellations according to their motion and direction, as has been demonstrated in the science of astrology . . . However, it was one of His great wonders that He placed within the upper realms alternate ways and forces by which one might change the governance of the realms beneath them . . . But it is the regular governance of the constellations that the Creator (blessed is He) desires, which He placed in them to begin with, and this would be the opposite. This is the secret of magic and its power, such that the rabbis said regarding magical practices that they "contradict the Council Above"; in other words, they subvert the simple forces of nature, which is a contradiction to the upper realms to some extent. Therefore, it is proper that the Torah prohibit them so that the world will be left to its normal function and its natural state, which is the desire of the Creator . . .
According to Nachmanides, together with the physical, natural world, G‑d created "spiritual" forces, or a "spiritual layer" through which the natural world can be manipulated. However, not all that is "spiritual" is necessarily "divine" or "holy." Sometimes it's quite the contrary. G‑d created nature together with its laws, and it is His will that the world follow and work within these laws. Therefore, if one subverts the system of nature through using this supernatural world, he is going against the will of G‑d.
Once you realize there is a spiritual force that has impact on this world and start to use it, the danger is that you will think that there is a separate force and energy, independent of G‑d, through which the world can be manipulated. This is idolatry.
(The reason why G‑d created the world this way is partially explained in my article Why Are There So Many Stars and Galaxies?)
Obliterating Magic and Sorcery
These two diametrically opposed views are both acceptable.
However, in light of the many instances of sorcery and magic discussed both in the Bible and the Talmud, some try to reconcile Maimonides' view with that of Nachmanides.
They explain that, notwithstanding his own statements to the contrary, Maimonides himself held that magic can work. So why did he take such a strong stance advocating the opposite? To distance people from practicing magic, either because a) magic comes from forces of impurity ; or b) because magic works when one believes in it, giving it an existence in his own mind. However, with regard to the evil eye and other things of that nature, the Talmud states that if one does not believe in them and gives them no room to exist, then they actually cease to exist. Therefore, by distancing people from the belief that magic works, that in itself causes it not to work.
But regardless of what one's views are about magic, all agree that it is in no way a contradiction to the unity of G‑d, and it itself (if it exists) is a creation of G‑d. Although in the present day, it is sometimes a challenge to recognize the true unity of G‑d, both in the natural and the spiritual, we await the day when His unity will be proclaimed by all. As the verse states, "And the L‑rd shall become King over all the earth; on that day shall the L‑rd be one, and His name one."