Bear in mind that programming is still a relatively new field.
HAHA what?! People have been programming for almost 60 years now. Hell, your bank is probably running code that is 40+ years old.Ageism comes as no shock when people think 6 decades is a long time for a profession to be around.
Bear in mind that programming is still a relatively new field. There are simply more young programmers out there. We see ageism more because it's an option. You can start a startup consisting only of young people.
I predict that as the field matures, it will become less of an issue. Companies won't be able to ignore older programmers (or at least will be less able to ignore them) because there will be more of them.