Keep in mind that this is not necessarily true for schools in countries outside of the US. At my school, KTH Royal Institute of Technology in Stockholm, as a PhD student you are considered an employee of the school and you are paid a living wage with full benefits. The current salary starts at 28600 SEK/month and can reach up to 33500 SEK/month [1] which is definitely a living wage in Stockholm, especially considering that you can live in affordable student accommodation (as long as you have been on the waiting list for at least a year or so for a student dorm). Sure, you can definitely make more money working in the industry, but at least you will not be living in poverty while pursuing your PhD degree.
As far as I know the public schools in Norway and Denmark operate very similarly to this, but I am not sure about other schools in Europe.
[1] https://www.kth.se/en/studies/phd/student/employment-1.52704...