https://www.marthastewart.com/7976833/how-clean-blackened-aluminum-pan
Short answer is it's a combination of the detergent and the water that causes tarnish. I have aluminum pans that I use for baking, and they don't do this in my dishwasher, so it's either that the detergent you use is particularly alkaline, or that your water is "hard water", having more minerals in it than usual.