A largely ignored issue that results in powders being considered "dirty" or "clean" is whether or not they are fired at close to their maximum burn efficiency or not - that usually happens near a given load's SAFE maximum in your firearm.
Stimpy got us on the right track by correctly noting that there are many factors that can affect burn efficiency. Generally (in addition to the other factors), the closer to a SAFE maximum that your load (or even a factory load for that matter) gets, the more complete burn efficiency becomes - and again, I say "generally," because there are still some powders that will leave more residue than others all other things being equal.
Powder, primer, bullet weight, case size and shape, barrel length, pressures, etc., are all factors that can work either for or against us as far as undesirable residues are concerned, but usually we can minimize our residue problems by loading more toward a given load's SAFE maximum than away from it (i.e., reduced loads).
If you have a powder that performs well, but you would like to see it leave less residue, try loading more toward your SAFE maximum load with that powder if you can find the accuracy you're looking for there - it may very well surprise you with less residue and less unburned powder.
Javelina