As noted above, class lights were an "old school" method of train/engine identification. The employee timetable used to list train "schedules", and a trackside observer (railroad employees) would see a train roll through "Clementsville" at 11:07 AM, and know that's train "404". If an employee was at "Clementsville" and saw a train come through at 10:57 displaying green class lights, he/she knew it was a "second section" of regular scheduled train #404, and the "real" 404 was still coming. And still yet, if an employee was standing at Clementsville and saw a train go by at 11:17 (after 404) with white class lights, it was an unscheduled "extra train" not listed in the timetable. The red class lights were used as marker lights, indicating the 3 light engines WERE the train, as opposed to a train's power running up the track for some reason, while their train was left behind.
All the class light / timetable rules were made pointless, and removed, from rule books when railroads started to run all their trains as "extras", and used the lead locomotive number as the new "identification". So, as opposed to being I.D.'ed as 404, nowadays they'd be "8774 West".
With regards to being able to light up individual class lights on either side of the locos, (green left, white right) that's not correct. There was a switch in the cab that controlled the class lights, and it was OFF-GREEN-WHITE-RED. If you saw different color lights lit up, it was because the switch was placed in WHITE, and one of the bulbs was hanging out of the white socket and illuminating the green lense from behind. This set up was unique to CP locos, as the US roads had a class light ON-OFF switch in the cab, and the Engineer went outside and manually changed the lense color to whatever color was required. In this case, it was possible to "mix them up" especially around Christmas; displaying one red light and one green one. Former Conrail units (purchased new by CR) had red lights only, to be displyed as "markers" with light engine moves. Most other roads didn't have these, they simply had a rule requiring a headlight on DIM displayed on the rear locomotive of a light engine set, to indicate the light locomotives were the "train".
CP has been removing the unused class light assemblies when locos are shopped for work. These assemblies are a source of water leaks, and are slowly being removed. Most, if not all, of the switches in the locomotive cab are disconnected, rendering the class lights disabled, even though the unit still has the lights on the locomotive exterior.