Leviticus 20:27

A man also or woman that hath a familiar spirit, or that is a wizard, shall surely be put to death: they shall stone them with stones: their blood shall be upon them.

Under the Mosaic law consulting those with familiar spirits and wizards was expressly forbidden as necromancy and sorcery and as communicating with evil spirits. Dealing with familiar spirits was an abomination to God. The prescribed penalty for it was death, to be carried out by stoning, with their blood upon them.

The familiar spirits involved were spirits of devils, or evil spirits, so the claimed communication with the dead was not genuine contact with departed people. The verse therefore condemns claims of communication with the dead as witchcraft and necromancy. Modern Spiritualism is a revival of that forbidden witchcraft in a new form or disguise.

Despite the prohibition, apostate Jews secretly practiced sorcery, including at Ephesus. Saul knew this law and had once ordered such practitioners put to death, but in desperation he turned to the very practice of necromancy he had condemned.