Why did my red chili powder turn brown?
What you are seeing is called oxidation (in most vegetable matter this is the enzyme breakdown of the phenols into melanin)

Some of the chemicals in the chilli powder have reacted with oxygen in the air, and over time have therefore changed colour. This is quite normal, and many foods exhibit this change

It most foods it does indicate a loss of flavour as well. This can be a good thing, as it may take away sharp tannin tastes for instance

In my experience chilli, whole or powder, changes in a good way with aging

The only way to reduce this effect is to pack the chilli powder in air tight containers, and use oxygen absorbers (pure iron) and a vacuum pump or flood it with nitrogen gas. Another way is to store it in the freezer, but this may have other undesirable side effects

Commercially some powdered foods are protected by coating them with a preservative, in this case citric acid. To be effective the surface of each grain of the chilli powder needs to be coated in a citric acid "film". The techniques for doing this are not generally possible, and may involve "secret" machines using ion-deposition, or centrifuge drying