What causes crackles on a USB microphone when connected via a USB hub?

Bad grounding affecting the analog circuitry in the microphone-preamp-ADC portion which then gets encoded in the digital signal sent to the computer.

Microphones tend to have ground shielding. Having it connected to the computer guarantees the integrity of that shield. Having it plugged into a hub, especially a cheap one doesn't guarantee that you have a true signal ground continuous from the mic, all the way to the computer. The ground shield on the microphone is probably floating, leading to electrical noise.

Upgrade to a high quality hub. Gold plating doesn't necessarily guarantee this as it's often added as a cheap and flashy way to visually impress. The contacts within the cable and the internal circuitry of the hub are way more important.

In the end, you will probably find that you need to have the mic directly connected to the computer to ensure good grounding. Alternately, get a quality extension USB cable, it will be cheaper.