In fundamental mathematics, at least in France, the custom is for advisors never to co-author (important) papers with their students. If an advisor does coauthor a paper with a PhD student, then it is assumed that he or she had to help the student more than should be expected, and this can prevent the student to get a job afterward.

This goes to the point of being arguably unethical in the opposite way than asked in the question, as most of the time advisors do have a role (if only suggest the question and the angle of attack) in PhD student papers.