I'm told this is a common path, at least in CS. apply to a phd program to get funding, do some research, take some courses, then drop out because you "just can't handle it" once you have enough credits for your free masters degree.
Maybe you're just putting it this simplistically for the rhetoric, but if you're doing research it's not really free. You're actually getting paid (albeit not much) and having your tuition waived to do work as a researcher.
I don't have any firsthand experience, this is just what a few of my friends at CMU have told me. they also complain about their paltry stipend, which I find kind of amusing considering that the waived tuition + stipend is close to what I gross for my fulltime SWE gig.
Grad student visas are a whole animal. Transitioning from an F1 to a H1b, or green card, is fraught with it's own complications. That's why most graduate schools are stacked international students. Americans and permanent residents wouldn't put up with it. And that is by design.