There are two standard answers for this.
First, at the time of the Salem Witch Trials, for example, the ideas of the Enlightenment had not penetrated all of society. Enlightenment thinking was still more of an elite phenomenon than something that had reached the masses. Therefore, many of the people who pushed for the witch trials would not know much about Enlightenment thought.
Second, the Enlightenment (and other forces) brought change to the societies that it affected. Fundamental change is always uncomfortable and people who are experiencing it often want to fight it. The witch hunts are often seen as reactions to the uncertainty of life. So, as change made life uncertain, people looked for scapegoats and settled on witches (because of #1 above many still believed in such things).
17th century was torn by wars of religion and imperial conquest and witch hunting.
As it is known, the French Revolution (1789) was one of the top point of the Enlightenment period. One of the goals that the Enlightenment proposed was the eradication of occultism and its practices.
One important motto generated by the Enlightenment and that characterizes secular modernism it is: in perspective, religion will be destroyed by science. Followers of such belief were hoping that so , are guaranteed not only human freedom to certain political, religious or church factors, but material happiness and unlimited progress.