My experience tells me that poorly managed companies are more ageist than well-managed ones.
The best managed company I ever worked for had uneducated 20 year olds working alongside 50-somethings with advanced degrees. People who are capable tend to ignore things like age, race and sex in my experience. They focus on ability.
Diversity is a result of maintaining a culture of excellence and recruiting from a diverse pool.