Not just in anime I think there’s a lot of common threads in regards to making the bad guys cool in fiction. There seem to me to be three main elements of this, sometimes a series only uses one, sometimes it uses a combination of them.
Romantic notions of chivalrous aristocrats/knights vs indifference to or even disdain for standardized, modern armies.
Legend of the Galactic Heroes is definitely a series that uses this in creating much of the appeal of the Reich (as well as Reinhard’s personal dynamism.) Despite wars being just as brutal in previous eras, there’s a lot of fondness for the supposedly gentlemanly way wars were fought when leadership was determined by high social standing. Since the officers (or in even older eras, knights) all came from the aristocratic class they brought their social habits with them to the battlefield and let things like honor and personal temperament get in the way of combat at times. Contrast that to the modern army where everyone wears the same uniform, carries the same weapons, and doesn’t have time for such uptight manners. It’s an issue of warriors vs soldiers, and warriors are much more romantic figures in fiction even if they’re nowhere near as effective in warfare. What did aces like Johnny Riden and Anavel Gato do for Zeon compared to a squadron of GM’s who worked together on the EFSF side? What did a few 100+ kill aces who stayed on the frontlines until they died accomplish for the Luftwaffe compared to squadrons of decent pilots trained by lower-kill count aces who were rotated back to be instructors for the USAAF? Not much. (Hope I’m not laying it on too thick there, but grounded as I am in military history it’s a favorite sport of mine to tear down the romanticism around the warrior myth.)
Going away from the previous element’s disdain for modernity, this one embraces it and polishes machine like standardization to an unrealistic but impressive level. Star Wars was big on this, making the Imperial Navy and Army chilling but impressive with just how perfect their standardization and coldness was. And when the army is machine like, it makes the one or two leaders like Darth Vader and the Emperor stand out even more as they command those forces.
A superior, overwhelming enemy.
This tend to cut both ways depending on a viewer’s preference, since it can make the bad guys seem impressive or make the good guys seem all the stronger for having to be such underdogs. All the series you mentioned in the post have this in them, and as it relates to making the bad guys cool it does so by making their accomplishments seem unstoppable or in some cases effortless. It inspires an admiration for just how capable the enemy is, for instance when Char would beat up on Amuro (though he had a small element of underdog to him since he didn’t have the vastly superior Gundam in 0079.)