If the student truly is writing a paper independently of the advisor, then the advisor shouldn't be a coauthor and it would be inappropriate for the advisor to demand this.
In the more usual situation in which the thesis supervisoradvisor provides the the dissertation topic and works directly with the student in developing the dissertation (holding regular meetings, reviewing drafts of the thesis, meeting with the dissertation committee) and then papers based on the dissertation are published, the participation of the advisor would normally merit coauthorship. In these situations the authorship of papers should be settled before the research work begins.
I make it a point to explain this to students before starting work with them on their theses and dissertations. I simply wouldn't agree to supervise a student who would not agree to sharing authorship in this way.