There's two pieces to this a) Facebook makes this possible and b) Facebook damns themselves and promotes that they make this possible for housing. Part b is easy to fix: make it harder to do housing ads that are targeted. However, part a is much harder: what stops me from advertising my AirBnb listing as a URL on Facebook as a "generic ad"?
You ask the user to say what type of ad it is, under penalty of violation of contract, and contractually obligate them to carry the legal risk if they lie.
There's no requirement that it be done via some fancy ML algorithm. I would expect that unless FB actively attempts to piss off the government, that would pass legal muster. Goodness knows I've signed enough agreements where I've agreed to very similar clauses just in normal day-to-day life.
Then again, I'm just a random internet person. If you're a lawyer, or if you can provide chapter and verse, I'll shut up.
The government is under no obligation to look at the terms of a civil contract when they decide who to prosecute.
The same way that newspapers, television stations, radio stations, magazines, and advertising agencies have for the last 200 or so years.
And they didn't have super-duper AI, the smartest people on the continent, and warehouses full of servers to help.
By not permitting Airbnb URLs as generic ads.
Edit to ad: and placing a warning if it looks like it might be a housing ad: “this looks like a housing related ad and has been flagged for moderation”
By doing it.
Facebook loves to try to play both sides, and claim to paying customers that it absolutely has the ability to do a thing, while turning round and saying to regulators that it is only a poor helpless social-media network utterly lacking in the ability to do such things.
If even a fraction of a fraction of a fraction of the capabilities Facebook claims in its materials for advertisers are genuine, it can figure out which ads are housing ads.