While it is not illegal to hire someone to write papers and written exams required at a university, doing so is a severe breach of academic ethics, according to The Atlantic. Hiring a ghostwriter does not constitute plagiarism, which is illegal, since it doesn't involve stealing any written work.
College professors are well within their rights to bestow a grade of F for work written by anyone other than the student, as The Atlantic explains. Hiring someone to write papers or take exams constitutes cheating. Online test-taking services have arisen as a response to more college courses being taught online, and some websites are even available offering services of faux students willing to take an entire course and do all the assignments for pay.