God does not have a gender. He is neither male nor female. Gender is a biological characteristic, and God is not a biological being. God is spirit (John 4:24) and spirit does not have flesh and blood (Luke 24:39). However, in the Bible God is always referred to in the masculine. This is most probably because of how God "the Father" relates to Jesus, who is the Son of God. He was born a male, and in the biblical culture the male is the one who represents his descendants (1 Cor. 15:22) and has the authority in the family (Gen. 27:1-29; 48:13-14). When Adam and Eve were in the Garden of Eden, Eve sinned first, but sin entered the world through Adam (Romans 5:12). This means it was the man Adam who possessed representative authority, not Eve. This phenomenon is called Federal Headship. Jesus likewise possesses representative authority since he was, and still is, a man (1 Cor. 15:22) who is God in flesh (John 1:1,14; Col. 2:9). Since we have an issue of authority in discussion related to gender, it makes sense to say that we would have God the Father and not God the mother since the male gender, biblically, represents authority.
A worthwhile comment is about Mormonism which teaches that God is male because he is an exalted man from another world who literally has a goddess wife. This is, of course, false teaching. For more information on this see Dictionary of false terms: God