The sun is the number one reason for brassy color, as it causes color to fade. This is why you should always keep color-treated hair protected from the sun. It's a good idea to wear headscarfs or hats to protect your hair during summer.
No matter how diligent you are in caring for your color there's one element that can't be controlled: oxidation. Think of how metal rusts when it is expose to outside environment for a long period of time, the same goes for hair.
Some tap water contain heavy metal and minerals that can alter your color due to chemical reactions between the color molecules and the chemical in the water. At-home water softeners or filteration systems can help.
Salt, heat and sweat.
Sounds like summer right? They are factors that roughen the cuticle, giving color molecules an easy way to escape from the hair shaft.
Using wrong product.
Products that contain sulfates and alcohol can lead to brassy strands since they strip away the color.
This chemical counteracts with the actual tone of the color. This makes hair appear dull and dry looking.