St. Paul directs women to do so (I Cor. xi. 1-16):
Be ye followers of me, as I also am of Christ. Now I praise you, brethren, that in all things you are mindful of me: and keep my ordinances as I have delivered them to you. But I would have you know, that the head of every man is Christ; and the head of the woman is the man; and the head of Christ is God. Every man praying or prophesying with his head covered, disgraceth his head. But every woman praying or prophesying with her head not covered, disgraceth her head: for it is all one as if she were shaven. For if a woman be not covered, let her be shorn. But if it be a shame to a woman to be shorn or made bald, let her cover her head. The man indeed ought not to cover his head, because he is the image and glory of God; but the woman is the glory of the man. For the man is not of the woman, but the woman of the man. For the man was not created for the woman, but the woman for the man. Therefore ought the woman to have a power over her head, because of the angels. But yet neither is the man without the woman, nor the woman without the man, in the Lord. For as the woman is of the man, so also is the man by the woman: but all things of God. You yourselves judge: doth it become a woman, to pray unto God uncovered? Doth not even nature itself teach you, that a man indeed, if he nourish his hair, it is a shame unto him? But if a woman nourish her hair, it is a glory to her; for her hair is given to her for a covering. But if any man seem to be contentious, we have no such custom, nor the church of God.
It is one of the oldest traditions in the history of the Church, required by papal command as early as St. Linus, the second Pope. It seems that this may be a matter of divine law and not merely ecclesiastical precept, based upon the above passage from sacred scripture. I believe theologians are split on the issue.
The woman ought to wear a covering for her head “because of the angels.” There are two things to consider in this. Firstly, it is a sign of her obedience not only to God but also to her husband. Even if she is not married, it is symbolic of her nature, as St. Paul clearly delineates in the above passage, and her role in society, which is more interior than that of man. Secondly (and more speculatively), all sacred things are veiled (the tabernacle, the ciborium, the chalice, etc.), for they hold the Body of our Lord. The relics of the True Cross are also traditionally veiled in red when not being venerated or used to bless someone, having been purpled by the Precious Blood of our Lord. A woman has the great gift from God to bear children, and this makes her body sacred.