The temple guards wear masks mainly to hide their identities and prevent others from recognizing them and causing conflicts of interest.