You bring up a good point. If you choose specifically to advertise to a specific demographic, can you be fined for NOT advertising to another? Is a company that puts a job offer ad in a men's or women's magazine breaking the law?
Does the men's or women's magazine explicitly work to prevent people of the other gender from being able to read its articles? You can legally pick an environment/medium in which to run your ad that may have a specific demographic, but when you get to explicitly set viewership then you have to be much more careful.
But that's not what "you" are doing. All these jobs are public. Every company in America has a jobs page that anyone of any age is free to look at.
What you are doing is not paying money to force your ad in front of people in a certain age.