Being asked to pay penalty if fail PhD qualifying exam Just to ask, how common is it for universities to ask a PhD student (fully funded) who has failed the qualifying exams to pay back partially or in full their stipend? 

I heard some anecdotes that some universities require students to pay the equivalent of masters course fees in order to graduate with a master degree. This is supposedly done to deter students who enroll in a PhD to get a free Master by deliberately (or otherwise) failing their qualifying exams.

Thanks for any input from any professors/ students inside or outside US!
In the United States, I have never heard of such a policy, and would consider it somewhat strange and vindictive on the part of the university.  Yes, it can be frustrating for professors when a student drops out with a Masters, but it's better to lose an unwilling or unable student early than to attempt to cudgel them along toward an ill-deserved doctorate.

In terms of "free rides" and "paying back," in most cases that I am aware of, a Ph.D. student who is supported by the department or their advisor is not just given money, but is working as a teaching assistant or research assistant.

Perhaps if one was supported by an external fellowship it might include such a term.  If I were a student, however, I would be very leery of accepting such an offer.