More precisely, sexism is a species of collectivism, which holds that individuals can be understood (and often judged) based on the characteristics of the group to which they belong, in this case, their sex group (male or female).
Discrimination based on sex is illegal in many countries. Most countries have laws that give special rights or privileges to one sex (feminists claim: mostly to men; masculists claim: mostly to women). Some countries ban sex discrimination but still have preferential laws in their law books.
See also misogyny, [gender roles]?, feminism, masculism, political correctness.