It wasn't.
The Greek text is pneuma ho Theos, it uses the definite article in reference to Theos, "God". Greek doesn't have an indefinite article, and so its inclusion in translation is up to translators, either for ease of reading or interpetation.
A word-for-word translation of this phrase would be "spirit the God", that doesn't make any sense in English; so grammatically it's "the God [is] spirit". In English we usually ignore the definite article with proper nouns, so "the God" simply becomes "God", since "God" is is a proper noun in English making the definite article superfluous. Including or excluding the indefinite article can potentially change the nuance of the text, and so whether to include it or exclude it in the translation is up to translator's interpretation and discretion.
Arguing in favor of its exclusion is a case I would make based on context, the context is the dispute between Samaritanism and Judaism on which mountain is sacred, and thus which temple is valid. Jesus' point is God's boundlessness, God is not found "here" or "there", because God is everywhere. The point is God's incoporeality. Thus "God is spirit" better serves to underscore that point. Whereas "God is a spirit" could suggest something else entirely, that there is some sort of class called "spirits" of which God is a member; but such thinking has no basis in biblical thought. As God is a "class" unto His own, as He declares, "I alone am God and there is no other." The ineffable, incomprehensible, and unimaginable reality of God's Essence speaks of His absolute otherness and transcendence from all conceivable things. In other words, it is impossible to say what God is in any absolute sense beyond that God is God. He is what He is, as He said to Moses, "I am that I am".
-CryptoLutheran