Is this different than advertising in a magazine that has a specific reader demographic? Or would that get a company in trouble too, if a the court rules that the intent was to exclude a given group?
It's against U.S. federal law for employers to discriminate against people aged 40-or-over on the basis of age. Having job ads that only younger people could see would seemingly fall afoul of that law: https://www.eeoc.gov/laws/statutes/adea.cfm
Seems like they should be advocating (at least in this use case) to stop the discrimination to increase profits.