The gossip section
In the previous example, the targeting engine's logic was easily discernable. I guess, theoretically, one could argue the same can be said for this placement, which appears next to an article about Andy Dick standing trial for sex abuse charges. Celebrity gossip gets lots of page views, so it's understandable why the brand would buy impressions on this site.
What went wrong: The brand might have been looking to align itself with celebrity gossip, and it's also possible that it was going after a keyword like "sexy." That strategy backfired, and it got a placement next to a story about sex abuse. This page is affiliated with a top-tier TV network, which shows that even if you limit your buy to premium sites, there is cause for concern.
How to prevent it: A lot of media buyers new to RTB will often simply make white and black lists of sites they want and don't want. The fact that this ad appeared on a premium publisher site speaks to the problems with this tactic. Instead of making site lists, focus on content you don't want your brand aligned with. There's an obvious difference between sexy and sex abuse, but if you set your RTB controls to avoid negative content, you'll preemptively avoid adjacencies that can jeopardize your brand.