You’re right. If they had said something slightly different, I would be mad. It certainly isn’t behavior to condone. In a political context, it probably is racist.
That said, I still do not think I would call it racism. Most of us prefer to be around people our own age when given the opportunity—for shared culture, lifestyles, etc. Is that ageist? I really don’t think that bigotry really applies here. It’s much more useful to apply solely to actions, which are easier to reason about. Discriminatory personal preference can certainly be harmful, but it seems like a distinct social phenomenon to bigotry.
More pedantry...
> So, the reason you'd admonish someone for saying something horrible is that they indicated they were thinking something horrible
No, the reason would be fear that they would act on their thoughts, or because their speech did affect people, not that their thoughts are themselves immoral.