Identifying the class of this word
The word government in the example sentence is a noun that functions as an adjective. It's typical native-speaker usage. The reason that it's a garden-path sentence is that at first glance, the reader will most likely think that the subject of the sentence is government and that the main verb of the sentence is plans.
The sentence is grammatical, but it's awkward because it initially confuses the reader, who has to stop and reread to parse the sentence. This is a mark of poor style.
To avoid the the garden path, the sentence should be changed to read:
The government's plans to raise taxes were defeated.
Governmental plans to raise taxes were defeated.
isn't a really good option despite its grammaticality. It sounds bad to me and will probably not be appealing to most native Anglophones.
The rule about part of speech (POS) is that words don't change POS, but some words are classified as both adverbs and adjectives, for example, as is the case with loud and fast.
More important than what POS a word is, is how the word functions in a particular context. What does it do? is a more important question than What part of speech is it?