One of the most lucid and sensible answers to this question appeared a few years ago in–of all places–a position statement on the teaching of grammar in American schools. Published by the National Council of Teachers of English (NCTE), the report is blessedly free of educational cant. Here’s how it begins:
Grammar is important because it is the language that makes it possible for us to talk about language. Grammar names the types of words and word groups that make up sentences not only in English but in any language. As human beings, we can put sentences together even as children–we can all do grammar. But to be able to talk about how sentences are built, about the types of words and word groups that make up sentences–that is knowing about grammar. And knowing about grammar offers a window into the human mind and into our amazingly complex mental capacity.
People associate grammar with errors and correctness. But knowing about grammar also helps us understand what makes sentences and paragraphs clear and interesting and precise. Grammar can be part of literature discussions, when we and our students closely read the sentences in poetry and stories. Knowing about grammar means finding out that all languages and all dialects follow grammatical patterns.