This conflates “lots of people are invested in the stock market” with “most stock market investments are held by everyday people”. If you tax companies, you are mostly taxing rich people, because they own most of the stock. So if you’re raising the money you saved from not taxing middle/low incomes by taxing companies, you are saving those individuals money.
That said, I favor mechanisms where offering stock as collateral for loans triggers capital gains taxes and taxing capital gains upon death as a better means of taxing the capital class than taxing companies.