As a former university researcher turned free lance medical writer, I am often asked to write an article from start to finish (which often includes the request to analyze the data, provide figures, tables, etc). Ghost writing doesn't just hurt the journal and it's readers, it stealing from the writer whose intellectual contribution made the article possible.
If I am writing the complete article- putting the hypothesis in context (introduction), writing out the methods, interpreting statistical results, and incorporating the new findings into the existing field of knowledge (discussion), then that merits an authorship. To ask a medical writer to have this level of involvement and not give them authorship is tantamount to intellectual property theft / plagiarism.