Typically to prevent abuse of employees, who often have far less power than a company does. That is unless they are organized as a group to heighten their bargaining power.
I agree, lets only hire heterosexual, white, Christian males under 35 years old, and exclude all other candidates if we want to! </sarcasm>