The difference here is that on a traffic light the colors are important and inherent to the traffic light's functionality.
This is not true in source code. Syntax highlighting "helps" you to spot strings, numbers, keyword arguments etc. faster. But normally this is not what programming is about.