I don't think ad businesses are/can be completely free of incentive misalignment--but the main thing is that imo that's true of all businesses, regardless of how they monetize.
for example, in regard to optimizing for engagement--yes, ads do incentive that, but so do subscriptions. Netflix is the prime example (the fact that they've recently got into ads notwithstanding).
substack and lambda school are also examples of companies that have incentive misalignment problems, despite all their emphasis on how aligned they are due to their business model. (I can elaborate on those once I'm not typing on my phone...)
to answer your question--how do you do it without perverse incentives--it's a question I've had in the back of my mind for a while. so far I think a couple things that can help are
(1) be transparent about the existence of perverse incentives--you can't even begin to address the problems if you pretend they don't exist
(2) avoid pressure to grow beyond your means. e.g. if you take a bunch of VC but it turns out the market opportunity of your business isn't large enough to justify the amount you raised, you'll be under a lot of pressure to make more money, with ethics possibly taking a back seat to some extent. (I'm not anti-VC in general for the record, I just think you need to be careful/honest about if it's really a good fit for your business)
(3) try to foster a competitive ecosystem, so people can switch to a different product if they feel like yours isn't built with their interests in mind. this is a large focus of mine with the unbundled-web thing (it's also why I'm not confident that VC will ever be a good fit for yakread)