“Since man cannot live without miracles, he will provide himself with miracles of his own making. He will believe in witchcraft and sorcery, even though he may otherwise be a heretic, an atheist, and a rebel.”
― Fyodor Dostoyevsky, The Brothers Karamazov
In 17th Century, scientists like Issac Newton, Johannes Kepler, Galileo Galilei, Antonie van Leeuwenhoek and Pascal came into prominence. They made tremendous contribution in field of astronomy, mathematics, physics and biology.
At the same time King James I of England got interested in science (actually pseudoscience) of Witchcraft. He travelled to other countries of Europe to understand how they dealt with witches. He wrote a book called Daemonologie in which he approves and supports the practice of witch hunting. James personally supervised the torture of women accused of being witches.
James came up with his own version of Physics, which was quite different from Physics studied by Issac Newton. James believed that water was purest of elements and therefore repelled guilty. Now if a lady accused of witchcraft, was indeed a witch, then water will repel her and she will start floating. If she was not a witch, she will drown. So if witch somehow managed to escape drowning, then she was declared witch and was put to death!
So for witch, it was thankless situation, if she was innocent, she will drown to death, if she survived; she was declared witch and then put to death. Such stupid theories were not confined to Europeans; their Americans counterparts matched them in ignorance. In Salem Witch trials around twenty people were executed after they were accused of witchcraft. Indian version of witch is called as Daayan. There are elaborate rituals to get rid of Daayan.
So advances in science do not necessarily result in removal of superstition and ignorance- both can coexist.