Even though Ninjas in popular culture wear black, there's no evidence that historical ninjas ever did.
It was more likely that ninjas would disguise themselves as civilians so that they could blend in with crowds. Since ninjas were supposed to be stealthy, early drawings of ninjas show them in black to convey a sense of invisibility.
(source)
