The following is an excerpt from The MacArthur New Testament Commentary on John 4.
God is spirit, and those who worship Him must worship in spirit and truth.” (John 4:24)
The phrase God is spirit is the classic biblical definition of the nature of God. Despite the heretical teaching of false cults, God is not an exalted man (Num. 23:19), “for a spirit does not have flesh and bones” (Luke 24:39). He is “the invisible God” (Col. 1:15; cf. 1 Tim. 1:17; Heb. 11:27), who “dwells in unapproachable light [cf. Ps. 104:2], whom no man has seen or can see” (1 Tim. 6:16; cf. Ex. 33:20; John 1:18; 6:46). Had He not revealed Himself in Scripture and in Jesus Christ, God would be utterly incomprehensible.
Because God is spirit, those who would truly worship Him must worship in spirit and truth. True worship does not consist of mere outward conformity to religious standards and duties (Isa. 29:13; 48:1; Jer. 12:1–2; Matt. 15:7–9), but emanates from the inner spirit. It must also be consistent with the truth God has revealed about Himself in His Word. The extremes of dead orthodoxy (truth and no spirit) and zealous heterodoxy (spirit and no truth) must be avoided.