You've been sold some BS. Usually this is because you're required to take a "reasonable" wage for your role in a company. Otherwise I guarantee you every independent contractor out there (among others) would be operating in a way that made 100% of their income business profit, rather than wages, as it has enormous tax advantages. Approximately everybody tries to find out the least they can take as wage income without pissing off the IRS, and sets their "wage" to whatever that is.
Do the math for yourself. Paying corporate taxes on profits, then dividend taxes on what gets paid out is not a savings versus paying income+payroll tax (which comes from money that is treated as an expense at the corporate level).
Sure, the stock price should somehow be tied to the actual value of the company, but for a while now it's been mostly indistinguishable from a Ponzi scheme other than a few companies that do sometimes decide to buy back some stock, which makes it slightly less sketchy but if the value is from the company buying it back, it's a lot closer to debt or a bond, which is not at all how anyone treats it.