Sure, it's easy to evaluate anything if you make up plausible-sounding numbers about it.
The costs of printing and retail are definitely less than half the sales price: https://www.davidderrico.com/cost-breakdowns-e-books-vs-prin... Publishers say it's 10%; Derrico thinks they are underestimating certain logistical costs but no way it's 50%.
Ok, then the other thing you're missing is that distributors also get a chunk of the ebook. You said ebooks have "no middlemen" but that's blatantly false, Amazon is the emperor of ebook middlemen. I suppose publishers could try selling ebooks directly but then they lose the Kindle platform + Amazon's reach, so Amazon charges for that service. They are a middleman.
And in some sense the publisher is a middleman. While authors can sell directly, they rarely do. All of the books I have read had editors, publishers, etc. Not just the author writing and uploading.
Scroll down to where the cost breakdown of a paperback is. More than $5 once you include distribution and retailing.
Or, as some might say, more than 50% of $10.