Term derived from Westerns wherein the hero usually wore a white hat (Typically always clean, no matter what happened). This is the opposite of a Black Hat, which is a person who was the villan.

Still not related to Red Hat.