Personification is quite common in Scripture.
In this case it was a specially comforting to Jesus' disciples to have the assurance from Christ himself that, although he would be physically absent from then on, the holy spirit would in turn, be certainly with them through all the impending trials as if it were a person. Hence, the masculine pronouns in the figure of speech. Elsewhere, for the most part, masculine pronouns are avoided.
Jesus himself made clear that he was using a comparison. Actually, it was his practice to speak in analogies. Jesus said the following a few verses after the "Helper" reference of John ch. 16: "These things I have spoken to you in figurative language..." (Verse 25, NKJV. Italics added.)