I don’t think anyone does grad school expecting that it’s going to be a good investment. Most people I know do it because they can’t imagine themselves doing anything other than research. Is it a waste if afterwards you just get some 9-5 software or finance gig? Definitely. That said, there’s few other ways you get to spend several years becoming a world expert *in a topic of your choice*