When a fan asked J.K. Rowling why Harry Potter wears glasses, Rowling answered: "Because I had glasses all though my childhood and I was sick and tired of the person in the books who wore the glasses was always the brainy one and it really irritated me and I wanted to read about a hero wearing glasses. It also has a symbolic function, Harry is the eyes onto the books in the sense that is always Harry's point of view, so there was also that, you know, facet of him wearing glasses (source).
Many readers of Chamber of Secrets have wondered why Colin Creevey survives the basilisk's glare by looking through his camera lens when Moaning Myrtle's glasses don't protect her at all. Rowling explains that looking through a camera means that there are several lenses keeping you from looking at the thing directly; glasses don't distort your vision at all. Still, she admits, "You can argue with me on that and I wouldn't blame you, but that is how I explained it to myself at the time" (source).
Lots of fans have asked Rowling why Hogwarts can't just dissolve Slytherin House, since it produces more that its fair share of Dark Lords. Rowling answers: "But they're not all bad. They literally are not all bad. [Pause.] Well, the deeper answer, the non-flippant answer, would be that you have to embrace all of a person, you have to take them with their flaws, and everyone's got them. It's the same way with the student body. If only they could achieve perfect unity, you would have an absolute unstoppable force, and I suppose it's that craving for unity and wholeness that means that they keep that quarter of the school that maybe does not encapsulate the most generous and noble qualities, in the hope, in the very Dumbledore-esque hope that they will achieve union, and they will achieve harmony. Harmony is the word (source).