Who says the ghostwriter is not an expert on the topic? The above is quite similar to a startup incubator, there is a demand in the marketplace that's unmet, one hires people to meet that demand and develop a product after which customers buy it.
An expert ghostwriter would be undercut by a ghostwriter supplying copy-pasted material just good enough to get past the publisher. A publisher who actually cares about whether or not the book is worthless would outbid this publisher for the skills of the expert.