They don't always wear a hat, but when they do, it's pointy.
Why do fantasy writers depict pointy hats as the headgear of choice for Witches and Wizards?
The primary reason writers still use the witch's hat in their literature is because the pointy hat is a form of writer's shorthand, a means to indicate to the reader we are seeing a witch, a being of power, of dark pacts, potentially dangerous, to be respected and feared. Yes, it is the very definition of stereotyping, but it works.
This image of the witch is personified for most modern people by the portrayal of the Wicked Witch of the West. (see below)
History of the Witches Hat
The stereotypical images of a witch is that of an ugly, old hag wearing a tall, black, pointed hat with a broad rim. There are different theories as to the origin of this stereotype, none of them certain.
Witches in the Air, Goya, 1798
It is images like this one which help to cement the pointed hat as a harbinger of magic, of potential evil, of forces dark and beyond the ken of mortal men. The history of wizards hats didn't hurt their reputations either.
Doing my own research, I noticed there were many images that included a buckle, much like a Quaker's hat, which has the same appearance except with a round dome. Among the Quakers, their hat was a symbol of social power and allegiance to their religion and each other.
The conical hat allows the witches to concentrate their sacred power. The conical traps the energy of the body and earth so that the witch can be centered with a power that is infinite.
A witch is a healer, plain and simple, and they've been persecuted throughout the centuries for the same reasons any other non-mainstream groups have been: fear of the unknown, and ignorance.
Witches are not creatures of evil, and they've never swooped down from the sky to harass people or eat small children. A witch is a protector, not a destroyer, and each witch has a unique personality, just like any other human being.
As for the hat... the cone-shaped hat traditionally worn by witches is symbolic of wisdom and intelligence, not being a dunce (good hell, the person who thought that one up needs a swift kick in the ankle). Its pointed shape represents the cone of power, which is associated with the circle, the symbol of the sun, unity, eternity, rebirth, and the triangle.