can you get in trouble for writing someone else’s paper

Paying someone to write an assignment for you is contract cheating, unethical, and does not allow you to own the work you buy.

can you get in trouble for writing someone else’s paper

Second, other students in the class did the work and are earning a grade based on their efforts. They chose not to pay someone to write their paper, either out of ethical concerns or fear of punishment, and are at a disadvantage to someone who simply paid for their paper.
As such, they can turn the paper in themselves, sell it to other students, post it online or do nearly anything they want with it.

Copyright © 2012 – 2020 All Rights Reserved – ClimateResearchNews
If you are contemplating writing essays for money, you should be aware that the students you write for will expect certain grades. Many students will want a guarantee that they will get at least an A or B on the essay and if essay does not deliver, there could be some potential issues. Your reputation as a writer will be on the line as students will pay you for a certain caliber of work.

Can you get in trouble for writing someone else's paper
I used something like a ghostwriter to help quickly publish a research paper. I was called before the chair of my department years ago and called a cheat and a liar. The ghost did appear as lesser co-author as I always intended and had previously agreed.

I think I understand the negativity on the page you mention. It arises from the fact that the CHE article is not really about ghostwriting at all. It is about one person paying someone else to write a paper from scratch. The student then presents the paper as his/her own work, even though he/she contributed absolutely nothing to the paper. That is pretty clearly immoral.

Some of the websites operate like eBay, with buyers and sellers bidding on specific assignments. Others operate like Uber, pairing desperate students with available writers. Either way, the identities and locations of both the writers and the students are masked from view, as are the colleges the assignments are for .
A major scandal involving contract cheating in Australia caused university officials there to try to crack down on the practice. A similar effort to confront the industry has emerged in Britain, but not in the United States.

References:

http://climateresearchnews.com/how-safe-is-it-for-students-to-write-essays-for-other-students
http://writing.stackexchange.com/questions/4527/is-academic-ghostwriting-legal
http://www.nytimes.com/2019/09/07/us/college-cheating-papers.html
http://www.plagiarism.org/blog/2017/10/27/is-it-plagiarism-to-pay-someone-to-write-for-me