maybe because according some culture, dark shade of purple can be mean death or sadness. so most villains will only bring death and sadness to people.
From the Roman emperors wearing phoenician red to Japanese emperors wearing murasaki, the wearing of the color purple was associated with half-divine rulers who could, more or less, change the world simply by thinking on it and saying a few words.
So, it could be that the color purple has burrowed into the everyone's subconsciouses as the color of the terrible powers of the unknowable other, which man in his ignorance might see as evil.
But I don't think so. More probably, it's just a coincidence, or a technical limitation of whatever production company they contracted out to make those cartoons.
Purple is often used for "evil" because it's a color rarely found in nature. Same goes for Blue, to a lesser extent. And when you DO encounter it in nature, it is usually a warning sign for something venomous/toxic.
Examples below...
And icy cold blue also helps thinking heartless. But you see in cartoon it is hard to use black for the villains (especially in the 80's way to ink and paint animation cells, if an exposition or a matte had an accident you still could barely see something).
Other thing that got vilified in black and white cartoons -and spawned infamous rumors- is those black ink fingers not being understood apart being inkblots if no gloves were on and invisible mouths while closed that asked for clown white contour lips. It translated as Cotton Club and racist stereotypes envisioning in time. (I got more on this but I dunna wanna turn it into cartoon/cinema political stuff.)
So, without using too dark colors so not to loose thin lines outside of Disney Animation studios and get into reshoots you could translate smokey grey=blue and black= mauve. It helps reducing the risks of ove/under exposure and reduced the time at the camera. I guess it stucked ith us a wee bit if you can remember Adam West's blue and pale gray Batman costume. (Ironically in B&W's Superman the costume used grey in stead of blue and black as red. Red often reads as black in black and white, but in color, it is also a royal/monarchic color so less used for villains.)
Note; I would say Cobra's gloves surprises me as it usually can be placed at less moving/easy readable costume positions; boots, belts, pants, hairs, pupils, inside of mouths, scars, logo. So, I wonder if we saw Cobra folding fists often or using knobs, buttons or moving a lot his fingers. Might had been fun for animators, a wee bit wince able for the paint department and facepalming at the camera end for most of the time! (Of course, early 2000 we ould just had filtered it by computer. ^^ Aw computer coloring times.)