It doesn't always maximize long term benefits. For instance, let's say you tend to only hire men because they are (by a hypothetical measure) better. If you have a bro work culture, that may make it harder to recruit and retain talented women. It may also make it harder to be sensitive to the needs of women users. The same goes for racial and cultural diversity.