Which is easier to read: white on a black dial or black on a white dial? It would seem most aviation instruments are white on black.
Black and white are perfect complementary colors, meaning:
When placed next to each other, they create the strongest contrast for those particular two colors.
But for instruments if they were inverted, strong daylight shadows will make the numbers and hands harder to read, while at night with the white typically being electroluminescent or reflective for the instrument's red or white light will cause the glow to wash over the black as illustrated below:
The red is used for easier adaptation to the outside at night. Too much glow in either case goes against that.
As for digital displays, the same principle applies. Try reading an eBook in bed with the background white and the brightness to full -- it's very tiring -- that's why eBook readers have a night option where the colors are inverted.
The earliest mention of it I could find was from 1937 in Flight when instrument panels (the six-pack) were being standardized:
The panel itself (...) is first anodised and then stove-enamelled a dull black -- though it may be said that the matt-grey anodic finish is very much better looking than the black panel and does not reflect light or in any way trouble the eyes of the pilot.
And here's another article from 1939 about solving the lighting issues for the instruments, not just the panel. But that wasn't always the case:
(Flight - 1913)
Image source: wikimedia.org
For night flying the white on black scheme emits probably 1 or 2% of the light that a black on white display does. This will make a very significant difference in cockpit light levels and night vision.
While lighting levels could be turned down on the black on white displays the contrast would suffer. With white on black the lighting levels can be left relatively high, the contrast will be improved and pupil contraction will be less when looking at the instruments.