Greek, like the Romance languages deriving from Latin (Spanish, French, Italian, etc.), assigns a specific gender for every noun. Every object, animate or inanimate, is designated as either masculine, feminine or neuter. The gender is often unrelated to whether the item is indeed masculine or feminine.
For example, in French the word livre, meaning "book," is of the masculine gender and is referred to by a pronoun equivalent to the English "he" or "him." And in Spanish, mesa, or "table," is in the feminine. Clearly, although these nouns have gender, their gender does not refer to actually being male or female. In the English language, in contrast, most nouns that do not refer to objects that are male or female are referred to in the neuter sense, with the pronoun "it."
We might note that in the Hebrew language, in which the Old Testament was written, the word translated "spirit," ruach, is referred to with feminine pronouns. But the Holy Spirit clearly is not female or a woman.
In Greek, both masculine and neuter words are used to refer to the Holy Spirit. The Greek word translated "Counselor," "Helper," "Comforter" and "Advocate" in John chapters 14 to 16 is parakletos, a masculine word in Greek and thus referred to in these chapters by Greek pronouns equivalent to the English "he," "him," "his," "himself," "who" and "whom."
Because of the masculine gender of parakletos, these pronouns are grammatically correct in Greek. But to translate these into English as "he," "him," etc., is grammatically incorrect.
For example, you would never translate a particular French sentence into English as "I'm looking for my book so I can read him." While this grammatical construction makes sense in the French language, it is wrong in English. In the same way, to suppose on this basis that the Holy Spirit is a person to be referred to as "he" or "him" is incorrect.
Only if the parakletos or helper were known to be a person could the use of a gender-inflected pronoun justifiably be used in English. And the term parakletos certainly can refer to a person—as it refers to Jesus Christ in 1 John 2:1. Yet the Holy Spirit is nowhere designated with personhood. So personal pronouns should not be substituted for it.
Furthermore, there is absolutely no theological or biblical justification for referring to the term "Holy Spirit" with masculine pronouns, even in Greek. The Greek word pneuma, translated "spirit" (but also translated "wind" and "breath" in the New Testament) is a grammatically neuter word. So, in the Greek language, pronouns equivalent to the English "it," "its," "itself," "which" or "that" are properly used in referring to this word translated into English as "spirit."
Yet when the King James or Authorized Version was produced (early in the 1600s), the doctrine of the Trinity had already been accepted for more than 1,000 years. So naturally the translators of that version, influenced by that belief, usually chose personal rather than neutral pronouns when referring to the Holy Spirit in English (see, for example, John 16:13-14; Romans 8:26).
However, this wasn't always the case. Notice that in some passages in the King James Version the translators did use the proper neuter pronouns. For example, Romans 8:16 says, "The Spirit itself [not himself] beareth witness with our spirit, that we are the children of God." Similarly, Romans 8:26 says "the Spirit itself [again, not himself] maketh intercession for us with groanings which cannot be uttered." In these cases the translators correctly used neuter pronouns because the Greek word pneuma, translated "Spirit," is neuter in gender.
Another example is Matthew 10:20, where Jesus says: "For it is not ye that speak, but the Spirit of your Father which [not who] speaketh in you." Another is 1 Peter 1:11, which refers to "the Spirit of Christ which [again, not who] was in them." The King James Version translators did use the proper neuter pronouns in these verses.
Regrettably, later English translators of the Bible have gone further than the King James translators in referring to the Holy Spirit with masculine rather than neuter pronouns. Thus the Holy Spirit is almost always referred to as "he" or "him" in the more modern versions. This reflects not linguistic accuracy, but the doctrinal bias or incorrect assumptions of Bible translators who wrongly believe the Holy Spirit is a person.