In fact gluons have a QCD charge, they just don't have a QED (electric) charge. That QCD charge is basically one color and one anticolor, minus the trace. So there are 8 different basis vectors that define the space for what the charge of a gluon is.