In some cultures it is reversed. It's mostly in European-based culture you see such a stark difference in light/dark, good/bad.
Exactly others see neither as inherently good or bad, just balance.
When I'm watching a movie and heaven/good guys represent light and demons are black
It's not always the case ...
It's just a matter of perspective.
Zorro, The Shadow, Batman, Miss Fury, Diabolik, Black Panther, SnakeEyes, proto-suit DareDevil, V, all dark themed good guys, all wear black.
Luke dons all black, embraces both halves within himself, in doing so knowingly walks his own path, finding redemption for himself and his father and a new path for the Jedi to return.
All white can be negative, as in the absence of anything, erased, white-washed etc...
Black-belt is the highest degree in martial arts white-belt the lowest.
Two of the most popular and recognizable icons in fiction, the villain Clown Price is bleached all white, the hero in black is the Dark Knight
The trope is flipped or subverted all the time in fiction:
So it's just whatever attributes you ascribe to it, mostly stemming from some basic primal and childlike fear of the dark and what you can't see.
It's why we harnessed fire, and created candles and flashlights, and hurled ourselves into space, to see the unknown what was on the dark-side of the moon etc.... to expose that neither one by nature is just good or bad. They just are, and the fear we bring to them is our own. (again Luke in recognizing this saves his father)
The trope maker Zorro subverted (the Hero) who wore dark colors all black, and rode a black horse, and embodies a black fox, All as power totems towards good.
His main antagonist the villain wore the white and bright colors, and rode the white horse.
Batman continues this to the day...
The flipped color trope, heroes black and villains white probably goes even further back, it's not new.
It just a problem when morons still look for and ridiculously ascribe good/evil attributes to skin color.