This is neither dirty nor a secret. Tesla is only able to sell these credits because they actually make zero-emissions cars, and they can only sell credits proportional to the cars they make.
If anything, it's a dirty secret that other manufacturers are able to get away with making polluting vehicles by purchasing credits from Tesla.