But your PhD won't just expose you to pure intellectual pursuits. You'll also see the downsides to academia. Pressure to publish or perish; anti-intellectual pressures to salami-slice your results, trade citations with friends and overstate the complexity of your work; the stilted language and awful writing of many papers; the need to go around cap in hand pursuing funding; the expectation to provide free labour to multinational publishing companies; the constant threat your competitors are fabricating or p-hacking results; and the risk you'll spend a decade 'paying your dues' in postdocs without ever earning tenure.
Sadly, this is not really the case. The job supply doesn't come anywhere close to the demand of (incredibly smart and well qualified) graduates. The vast majority who choose to stay end up as sessional instructors, with little to no hope of attaining tenure. And with each passing year as a sessional instructor, your chance of becoming a "real" professor drops substantially.
Mathematicians don't get up to p-hacking, thankfully, and while some of your issues are present, you're missing a lot of the actual issues if you manage to get on a tenure track: time on committees, shitty department politics, whiny undergrads who don't want to be in the classes they've signed up for... yeah, there's a lot of problems. But, even with all that, I'd take it over a lot of the jobs I was qualified for before uni.