ATF is used to lubricate the pumps and injector o-rings on diesel engines, not for cleaning purposes; the low sulfur diesel blends cause the moving parts and soft parts to fail much more frequently than the older diesel blends so adding some drain oil from the engine or ATF restores most of the lubrication lost in the low sulfur fuels.
ATF also helps lubricate cylinders and rings on engines that have sat long enough to be dry on the top end, mainly because it is lightweight and easy to get into the cylinders but most guys have their own "favorite" lube for getting old engines to return to service.