And more important, to many new and more established writers, the editors in publishing houses provide serious value in the form of advice and guidance. It's easy to think that because you read books you surely know how to write a good one. But that's similar to thinking that because you use applications you surely know how to code a good one.
And lastly, good publishing houses serve as brands for consumers. People won't see a self-published technology book with the same eyes as if it was published by O'Reilly (for example). From past experiences they probably feel guaranteed of a certain level of quality from the O'Reilly book that a small lone author almost never can provide
I'm not claiming that the publishing system is a panacea or that all editors are amazing. But you described it as mostly useless, bordering on a ripoff, and I think it's far from the truth.