They’re almost a web fixture: Those spammy-looking links at the end of news articles, with photos of former TV stars and headlines like “What she looks like now will amaze you!”

But despite the fact that many readers—and news companies, for that matter—hate them, they’re probably not going away anytime soon.

The reason for that is fairly simple: Those links make media companies a significant amount of money. And many of those outlets are so desperate for revenue that they are willing to do just about anything.

Depending on the size of the outlet and the amount of traffic they can generate, a contract with Outbrain or Taboola—the two largest providers of such links—can mean millions of dollars in guaranteed annual income. And if your print advertising is declining 30% in a single quarter, that sounds great.

To take one prominent example, Time Inc. (which owns Fortune magazine), signed a deal with Outbrain in 2014 that was worth an estimated $100-million to the magazine publisher over three years.

Sign up for Data Sheet, Fortune’s technology newsletter.

In a recent piece, the New York Times outlined the downside of these kinds of links. One of the most long-lasting effects is also the hardest to measure, and that is the impact on a company’s reputation.

Outbrain links
Fortune

If you just published a long investigative piece of journalism on an important topic like immigration or the U.S. political landscape, what message does it send when the reader gets to the bottom of that story and sees links to cheesy sites using photos of scantily-clad women and other gimmicks?

Slate is among the media outlets that have decided to stop using such links because of the potential damage to the site’s reputation, according to president Keith Hernandez. “It is not the right look if you’re trying to say you’re a high-quality, upper-tier website,” he told the Times.

Looking bad isn’t the only downside. Many of the sites included in the links are also dodgy publishers of the worst kind of viral clickbait, and in some cases fake news and hoaxes.

Media companies aren’t the only ones struggling with this problem. Even Facebook is having a hard time keeping fake news reports and spammy websites out of its Trending Topics section, and there are experts who are skeptical of Facebook’s ability to ever stamp them out with its algorithms.

But those are sites that make their way into Facebook’s listings organically. Taboola and Outbrain links on many sites are there because those outlets host them voluntarily in return for payment.

The nonprofit group behind ChangeAdvertising.org found that 41 of the top 50 news sites, including The Guardian and CNN, use widgets from “content recommendation” companies. Although some of those links are ads (including ads from other publishers), more than 25% comes from shady clickbait sites.

In effect, these sites are playing a vast game of advertising arbitrage. They pay for their appearance inside the Taboola or Outbrain widget, and then they hope to make enough money from the ads on their own sites to justify that expense. Many reputable media outlets are effectively making a similar bet.

Peretti: We Want to Make Media for the Way the World Is Today

It’s the same kind of ethical arbitrage that takes place on many media sites when it comes to other forms of advertising. They hope that they can make enough money from low-quality banner ads to justify the irritation and potential loss of traffic from users who hate them.

If that feels like an unsustainable situation to you, that’s probably because it is. Media companies that make these bargains are chasing page views and clicks that are worth less and less every day.

Meanwhile, Facebook is generating billions of dollars in revenue from its advertising, and that makes revenue-sharing partnerships like the ones it has struck with a number of media companies (for its Instant Articles mobile platform and its Facebook Live video feature) even more appealing.

By using questionable ad strategies like Outbrain and Taboola, in other words, you could argue that some media outlets are hastening their own demise. But for some—particularly those that are publicly traded—revenue from questionable content is better than no revenue at all.