Because the cabin is pressurized when in the air, and those fans are tuned to specific air pressure. When at the gate with the hatch open the air is not circulated as this would cause the hatch to blow air in/out, not necessarily good as the air quality on Tarmac is poor b/c of the fumes from exhaust and jet fuel. So my guess is keep the air movement in/out of the cabin to a minimum while docked.
But it does get stale and hot sometimes doesn’t it?