Beer was the staple drink as it kept better than water and had nutritional value. Brewing beer was women's work in every household. Some expanded to sell beer at markets, and the pointy hat became a marker for a woman who sold beer.
When men started breweries, it was about the time of witch hunts, and they started to accuse women brewers of witchcraft as a way of removing the competition — and that is how the pointy hat became associated with the image of a witch. Also, the beer was brewed in cauldrons, and cats were used to keep mice away from the grain that the beer was made of.