God the Father and God the Holy Spirit are pure spirit and do not have gender. God the Son, from all eternity until the Incarnation, was also pure spirit and did not have gender. At the Incarnation God the Son became the man Christ Jesus while still remaining the eternal Son of God and so is a man in his human nature. Masculine pronouns are used in reference to the Trinity because God has chosen to reveal himself to us in masculine terminology.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.