The work of a student is the property of the university, like the work of an employee is the property of the employer. It's the university that (temporarily, before transferring it) owns the copyright on the paper the Ph.D. submitted. Not the Ph.D.
An employee's labor is purchased by the employer.
A student in a university is not paid to attend a university however; the contrary is true. A student has far more claim on the works of professors than vice-versa.
Hmmm, yes, I'm describing how it is in Europe, where higher education is heavily subsidied by the government and where Ph.D. students are employees of the university.
Usually contractual agreements between an individual and a company, such as a university, can override the default rights granted by law. You can always sign away your rights, so we would at least need to know the default clauses in employee and university-enrollment contracts.