Virtually all biologists agree that sperm producers are male and egg producers are female, meaning that sexes can be defined in terms of the type of gamete, or sex cell, an individual produces. In sexual systems in which gametes of two different sizes fuse, the smaller sex cell is usually the sperm and the larger one is usually the egg. In sexual systems in which fusion takes place between cells of the same size, many biologists refer to "mating types" rather than "sexes." But for our purposes, the distinction is largely semantic, since most such species have only two mating types. (An exception: some ciliates.)
What about hermaphrodites, which produce both eggs and sperm? The biologists I spoke with said they tend to think of hermaphrodites as being of both sexes, rather than representing a third type (though there are some dissenters out there). Thinking of clam shrimp as having three sexes means defining hermaphrodites as a separate sex—and defining the two types of hermaphrodites present as two different sexes. Some biologists are willing to go there but others aren't.