I'd say that it is always gambling because there is risk involved.
But I would say that both traditional gambling and investments have the same threshold for problematic behaviour, and that is when you spend more money than you can afford to lose. That is regardless whether you win or not.
I do t consider bonds or CDs as gambling. They are guaranteed unless the entire financial institution dies, in which case your investment in ammo matters more than money.
I'd go further than that and say that deciding to leave the house or not, are both gambles.
But in the context of spending money with the only net result being you lose money, make money or retain the same money with no other goods or services provided in return. Then gambling is the primary attribute of that spend.
Bookmakers and investments meet that criteria, your other purchases are not.