Here is a nice lithography showing what you're describing. This dates to 1865 by the famed artist George Cruckshank for Robert Hunt's collection of Cornish folklore. The association of pointed hats with witchcraft is old and is based on traditional headwear found in western Britain, especially in Wales and Cornwall/Devon. Traditional practices, traditional headwear, and folk remedies all tied nicely together in the popular mind, hence the association of this type of hat with witchcraft.
Several theories:
Pointy hat has not been popular since Medieval times, so wearing a pointy hat is an indicator of being different than others.
It's a "deviated" form of steeple hats worn by Puritans. People who dress differently from the norm could face accusations of being a witch. In addition the point could indicate devil's horn.
In the Fourth Council of the Lateran, Jews were required to wear hats like these. Anti-Semites has long associated Jews with Satan. According to the book Eyewitnessing: The Uses of Images as Historical Evidence, people arrested for witchcraft were obligated to "appear in public wearing a so-called Jew-hat" (and according to the same chapter, the image of hooked nose also came from Anti-Semitism).