I think the easiest solution would be to disallow ads of those categories on their platform. I'd think the risk of "facebook/instagram is racist" damaging their brand and the cost of federal discrimination lawsuits would outweigh whatever revenue they project.
As an aside, I know it's faux pas to bring up any observed (and/or presumed) differences between the protected classes - but maybe (just maybe) Facebook's targeting is smart enough to correlate "most likely to care" about things that tend to have skewed demographics without looking at the demographic data itself. Like the example in of truck driver ads targeting men, what is Facebook using to determine who they target? And do those data points line up with demographics?
I don't know, but these kinds of systems are tough to introspect from the outside.