I have always been in two minds about the formal teaching of grammar.
If grammar is taught as a means to an end, increasing the learner's ability to produce articulate, coherent, comprehensible and meaningful language, then I am completely in favour. A person who produces such language as "Me and me mates has agreed to what you wants" is unlikely to obtain a senior position in the Civil Service. Teachers need to make it possible for such people to produce, in the appropriate situations, some words such as, "My colleagues and I have agreed to what you want / your request". In order to assist in this task, such words as subject, object, noun, verb, pronoun, agreement, etc can be useful aids. Identification of parts of speech in a sentence is one way of providing learners with learning aids.
However, too often these means become an end in themselves. The question of whether 'my' is a possessive adjective, possessive pronoun, possessive determiner or some other term, which may be of interest to academic grammarians, is of little value to non-native-speakers or to 99% of native speakers.I feel sorry for some of the learners who send into this forum such questions as "Is open in 'The door swung open' an adjective or an adverb?'. A vital mark in an examination may depend on what the teacher believes is the correct answer. I am sure that some members become understandably frustrated when one of us asks why they want to know, or says it really doesn't matter, or that there are arguments for both answers. The fact is that that such questions add little to our ability to use the language, in my opinion.
Also, I fear that over-emphasis on formal language could lead to a return to the bad old prescriptivist days. Those who decry falling standards and regret the acceptance of the splitting of infinitives or sentence-ending seem to be ignorant of the fact that many of the 'good old-fashioned rules' were completely arbitrary. A self-appointed clique of speakers of a minority dialect of English managed to convince people that theirs was the only correct way to use the language.