The words of the Gospel, For God is Spirit (John 4:24), need careful examination as to their sense and their purpose.
[…] The Lord was speaking with a woman of Samaria, for He had come to be the Redeemer for all mankind.
After He had discoursed at length of the living water…the woman answered, Lord, I perceive that Thou art a prophet. Our fathers worshipped in this mountain; and ye say that in Jerusalem is the place where men ought to worship (John 4:19-20).
The Lord replied, Woman, believe Me, the hour cometh when neither in this mountain, nor in Jerusalem, shall ye worship the Father.
[…] But the hour cometh, and now is, when the true worshippers shall worship the Father in the Spirit and in truth; for the Father seeketh such to worship Him. For God is Spirit, and they that worship Him must worship in the Spirit and in truth, for God is Spirit (John 4:19-24).
We see that the woman, her mind full of inherited tradition, thought that God must be worshipped either on a mountain, as at Samaria, or in a temple, as at Jerusalem.
Samaria in disobedience to the Law had chosen a site upon the mountain for worship, while the Jews regarded the temple founded by Solomon as the home of their religion. The prejudices of both confined the all-embracing and illimitable God to the crest of a hill or the vault of a building.
God is invisible, incomprehensible, immeasurable; the Lord said that the time had come when God should be worshipped neither on mountain nor in temple. For Spirit cannot be cabined or confined; it is omnipresent in space and time, and under all conditions present in its fulness.
Therefore, He said, they are the true worshippers who shall worship in the Spirit and in truth. And these who are to worship God the Spirit in the Spirit shall have the One [i.e. the Holy Spirit] for the means, the Other [i.e. God the Trinity Who is Spirit] for the object, of their reverence. For Each of the Two stands in a different relation to the worshipper.
The words, God is Spirit, do not alter the fact that the Holy Spirit has a Name of His own, and that He is the Gift to us. The woman who confined God to hill or temple was told that God contains all things and is self-contained: that He, the Invisible and Incomprehensible must be worshipped by invisible and incomprehensible means.
The imparted gift and the object of reverence were clearly shewn when Christ taught that God, being Spirit, must be worshipped in the Spirit, and revealed what freedom and knowledge, what boundless scope for adoration, lay in this worship of God, the Spirit, in the Spirit.
Hilary of Poitiers (c.300-368): On the Trinity, 2, 31 [slightly adapted].