The pointy hats or hoods serve to disgusie the height of the wearer. The different associations or whatever they call them often wear different colors, but other than that the idea is to be totally unknown.
My understanding is that the idea is to be able to do good works for the needy and the church without being so vain as to credit yourself as an individual for this good work. In other words, the work is done because it it needs doing and not because you desire to reap any social or spiritual rewards for yourself.
The custom seems to be practiced in Catholic communities throughout southern Europe. It most assuredly predates the KKK by many centuries.
The KKK liked —and probably still likes— to cloak itself in a pretense of honor, tradition, and religion. But being an essentially criminal/terrorist organization, it needs this self-invented cover.