How can a pathogenic bacterium be avirulent?
Streptococcus pneumoniae is a pathogenic species. Streptococcus pneumoniae R6 is an avirulent strain of this species. Presumably this means that specific virulence genes that are present in virulent strains of Streptococcus pneumoniae are missing or mutated in the R6 strain. In fact the most likely difference would be that virulence factors are encoded by a plasmid that has been lost in the avirulent strain. 

The use of avirulent strains is a common strategy for studying pathogenic bacteria, although obviously it precludes studying mechanisms of pathogenicity directly.