Earlier quoted context omitted.
I wondered about this too, but both sides of the ratio are denominated in current dollars, so dollar valuation is already divided out: ratio of total US stock market value to US GDP
There's just one more step; the market's value is an expectation of the future while the GDP is a 'now' metric. So while inflation is auto-adjusted (roughly) in the past, a strong expectation of inflation now can send the market cap up (and either GDP will catch up, be it natural or on inflated dollar terms) or the market will crash, or some combination of the two to bring the indicator back to earth.
Historically stocks perform poorly in times of high inflation.