Actually, if you want to get into that side of it, one of the main reasons it's unlawful to discriminate against them is because they are more expensive to companies (health, pensions, 401k, etc). Because these are often the things that drive expenses at company, so they like to
terminate them when they become too old.
The ever-growing aging workforce being terminated unilaterally is what caused most of these acts.