Probably because black has been associated to “death” for millennia (it’s the color of night, which is traditionally dangerous), while white is associated to cleanliness and light. We’re talking Egyptian times, Ancient Greece, etc, when there wasn’t really a concept of “white skin” (more or less everyone in highly-populated European and North-African regions had brown skin, to survive under the sun; very few people even lived in Northern climates). What do you wear when somebody dies, in the Mediterranean region? Black. What do you wear when you celebrate? White.
The symbolism is extremely obvious and pre-dating even the “discovery of America”.