So highest-grossing doesn't mean absolutely anything about how good a movie is, or whether people actually liked it. There is a huge contingent of people that follow religiously a franchise and will pay to watch the new one even if they've been told it is not very good. You don't skip the latest Star Wars movie if you call yourself a Star Wars fan, and it is marketing's job to create the Star Wars fan in the first place.
As a cynic, I'd argue the opposite to what you said: you have to spend more on marketing if the material is not very good in the first place. The result is a terrible movie that becomes a meme and still makes bank.