httpwebwitch - 2:33 pm on Jun 17, 2010 (gmt 0)
etymological note: the idiom references idealized western movies where the hero always wears a white hat and the villain wears black. Whether this is factual is not the point.
Actually I suspect it's not so much the western movies, but the Looney Tunes parodies of those westerns with Daffy Duck that solidified the white/black hat uniform. That's my theory.