Are you really extrapolating your one example to apply to all cases? Maybe you should take a few stats classes while you're still in grad school.
Firstly, you seem to be really lucky because a lot of grad students basically spend their masters working on what their advisors want them to and being lab monkeys. Things change once you get to PhD sure but you have to grind out two years to get there.
Secondly, not all corporations are closed source. Many companies, especially tech-focused companies, have tons of open source initiatives. A lot of amazing tools come from industry. And it's not like all grad programs are havens of FOSS - there's an endless supply of papers and projects whose code is either a) non-existent or in the form of snippets or b) blocked by a paywall (to get to the article to see the snippets if they exist).
Additionally, you can choose what company you work for. If you want more autonomy or ownership, you can filter for that. I joined a company fresh out of undergrad and I was pushing product-changing code in a few weeks.
Most of all, the reason why everyone doesn't go to grad school is because not everyone can get into grad school. You are going to a top tier program at a well-regarded (and well-funded) university. That's probably why you are having such a positive experience. These positions are, by their definition, exclusive and available only to a very small percentage of coders. People rag on industry about gatekeeping (throwing resumes in the trash if they are from the wrong school) but it happens even moreso in academia. I've coded plenty of projects in my spare time, have created and implemented novel solutions, can talk intelligently about a wide range of topics and have spoken at conferences...but if my GRE / GPA scores are too low, then you're SOL for the most institutions. They'll still keep the $100 application fee of course.