If you have a bad ground, the current will complete the circuit by following the other filament in the bulb, because they share a common ground. This backfeeds into the wiring and finds true ground via the element in other bulbs.
Whenever attaching lights to a trailer I prefer to use star washers under any nuts. Star washers will cut through the paint and into the underlying metal to ensure a ground. Even so, it is possible for whatever the light is bolted to to have lost its ground as well. For example, a light bolted to a fender which may have corrosion to the bed. Or even a bed that may be too corroded to the frame, etc.
And some trailer wiring has imperfect grounds to the tow vehicle. You can use a jumper cable between the tow vehicle frame and the trailer frame to test for this condition.