This comes from tradition when it was considered "bad" even for christian women to go out of the house without a head covering.
Consider 1 Corinthians 11:
"3)Now I want you to realize that the head of every man is Christ, and the head of the woman is man, and the head of Christ is God. 4) Every man who prays or prophesies with his head covered dishonors his head. 5) And every woman who prays or prophesies with her head uncovered dishonors her head—it is just as though her head were shaved. 6) If a woman does not cover her head, she should have her hair cut off; and if it is a disgrace for a woman to have her hair cut or shaved off, she should cover her head. 7) A man ought not to cover his head, since he is the image and glory of God; but the woman is the glory of man. 8) For man did not come from woman, but woman from man; 9) neither was man created for woman, but woman for man. 10) For this reason, and because of the angels, the woman ought to have a sign of authority on her head. "
With the protestant reformation, this was revolted against, and men wore hats in church and women didn't. But the catholics stayed true to this maxim.
Not that I agree with that bible text! Just letting you know the tradition came about. And as you know, traditions die hard, especially cultural clothing considerations. You wouldn't, for example, go to the beach in a ball gown, or show up at a wedding in a bikini. And so is the question of the hat in church--it's just something one does or doesn't do... :)