Actually the issue is that the companies paying you to run the ads don't want you to host it yourself.
* They're paying for impressions, and they don't trust you to report those honestly.
* Real time bidding means the ad to be displayed often hasn't been determined until a few milliseconds before the page loads in your browser.
* They can't (as easily and reliably) collect demographic and behavioral data (ie spy on you) if you don't contact their servers directly.
I ran a pretty popular wiki for Dungeons and Dragons homebrew on what used to be called Wikia. At some point they decided they available needed to have some terrible new skin that was stuffed with ads and unbelievable ugly. We pushed back but they were adamant about forcing it, so I took all the content and all the users and self hosted it for almost a decade afterward. The Wikia site was completely dead. Sucks for them but their choice.
I paid $10/mo or $10/mo for the site depending on the year, and never ran ads. At one point I got an offer from a company in the same hobbyist space to buy it from me. At that point I was extremely sick of being my own sysadmin and worrying about security vulns so I accepted it. Now some time later they're trying to pull the "stuff it full of ads in the worst places!" routine. Users are getting pissed and starting to ask me about taking all the content...and users...and going off to a server adminned by me again.
If I do this, it will be completely devastating for the site and tank their traffic. Do they care or realize? Guess we'll see.