I know of a few departments that do it, and some professors as well (1). I'm sure not all do, but I think it's pervasive enough to worry about.
Regarding legality, I actually made a mistake when I said reject due to age. I meant reject due to having stale ideas and not appearing committed enough, or just not standing out from the crowd.
(1) Admissions process at many places: committee weeds out the weakest and professors/groups pick their students from the remainder. If a professor in your field doesn't like 30 year olds, you failed to stand out from the crowd.
Regarding legality, I actually made a mistake when I said reject due to age. I meant reject due to having stale ideas and not appearing committed enough, or just not standing out from the crowd.
(1) Admissions process at many places: committee weeds out the weakest and professors/groups pick their students from the remainder. If a professor in your field doesn't like 30 year olds, you failed to stand out from the crowd.