This is unambiguously illegal and Facebook could stop doing this anytime it wants. Craigslist reminds its users about anti-discrimination laws before they post and provides a means for users to flag illegal ads.
Right now the targeting information for an ad is not disclosed to the recipient, so it's not possible for an end user to know if a given ad is illegal or not unless there's discriminatory information directly in the copy, which is pretty rare.
If you click the three dots on the top right of an ad in the newsfeed, you should be able to press 'Why am I seeing this' to see an explanation of the targeting for an ad. I can see one on my newsfeed that says:
> One reason you're seeing this ad is that Castore Sportswear wants to reach people who have visited their website or used one of their apps. This is based on customer information provided by Castore Sportswear.
> There may be other reasons you're seeing this ad, including that Castore Sportswear wants to reach people ages 18 and older who live in the United Kingdom. This is information based on your Facebook profile and where you've connected to the internet.
Is it hard to think of a single job posting that would only be available to only men OR women? Entertainment jobs are especially constrained: Exotic male dancer, exotic female dancer, specific roles in tv/movies/plays, Hooters waitress, etc.
OK you got me, exotic dancers didn't cross my mind xD
TBH it does seem a little discriminatory that a place gets to decide "all our waitresses are women", or "only women dance here", but I can see how industry's could be grandfathered in...