Deuteronomy 18:9-12 (JDV)
Deuteronomy 18:9 “When you enter the land Yahveh your God is giving you, do not imitate the repulsive customs of those nations.
Deuteronomy 18:10 No one among you is to sacrifice his son or daughter in the fire, practice divination, tell fortunes, interpret omens, practice sorcery,
Deuteronomy 18:11 cast spells, consult a medium or a spiritist, or inquire of the dead.
Deuteronomy 18:12 Everyone who does these acts is repulsive to Yahveh, and Yahveh your God is taking possession from the nations before you because of these repulsive acts.
The acts defined as repulsive to God here are all practices associated with animism. Animism as a world-view is thought to be primitive — customs that the modern world has evolved away from. Nothing could be further from the truth. The root is animism is doing what works for me — regardless of how it hurts others.
I never read the Harry Potter series, but I suspect its author wanted people to imagine someone using spiritual power for good. Harry Potter is fiction. Such animists do not exist in real life. Instead, those who seek to harness the powers of the spirit world are all deeply selfish beings who want power over others to benefit themselves.
That is why Moses brands all such persons as repulsive to God. It was this sinful selfishness that doomed the nations to lose their territory and identity as a judgment from God. Moses assumed that some of the Israelites would be drawn toward the practices of animism, perhaps thinking that they could adapt the customs to their worship of Yahveh. Moses knew that such a thing never really happens.
Lord, give us the wisdom to stay away from all the things that repulse you.