I'm not sure it's that simple. There's a wide spectrum of types of gambling, and equal variation in the laws regulating those types. Going to Vegas and losing your money on dice sounds like commercial casinos, which is why I chose to highlight it. Most states do have lotteries, as you point out, and gambling where the proceeds go to charity is also legal in most states (see previous sources in this thread). Once you start shifting the type of gambling, though, you also get further from the analogy at hand. One way to look at it is that providing revenue for education or charities could be seen as a public good that outweighs the undesirability of gambling.
To take it back to the original argument, the question is then to decide where investing sits on that spectrum. I am not sure, but I do think there are enough reasonable differences between investing in securities, commercial casino gambling, and lotteries to expect that they may have different regulations.
To take it back to the original argument, the question is then to decide where investing sits on that spectrum. I am not sure, but I do think there are enough reasonable differences between investing in securities, commercial casino gambling, and lotteries to expect that they may have different regulations.