Selling access for attention of people that fit specific characteristics has been done for decades and its fully legal; that's why bingo shows aimed to old people get Viagra ads, that's why the Seventeen magazine gets acne treatment ads; sure there are some non-teenagers buying the Seventeen magazine but its such a tiny minority that its irrelevant.
But to categories that are not protected its against the law also FB was until recently allowing people to sell adds targeting people with anti semitic views