Mass spectrum and statistical entropy of the BTZ black hole from canonical quantum gravity