You can engage in gambling or speculation when trading forex, because it enables both activities. There are rational reasons to engage in speculation, whereas there aren't any to engage in gambling. Generally the test of rationality lies at the line of information asymmetry: do you have information which the market does not? Then you can engage in speculation and positively inform price discovery, which contributes to the well-functioning of the market. If you do not have superior information and you're not trading on the fundamental value of a thing, you're gambling. There are similar tests to distinguish gambling from hedging and arbitrage, both of which also comprise legitimate economic activity
Graham himself acknowledges in that very book that speculation is a necessary function for markets, because someone needs to accept risk in order to keep the value machine running (i.e. empower short term price discovery). His primary thesis is not that speculation and gambling are equivalent; rather, that as an individual you are more likely to be gambling than speculating.
While modern perspectives on this topic do split hairs, the generally accepted view is that speculation and investing operate along a continuum. Strong opinions to the contrary tend to be rooted in moral and ideological disagreements, not economic nuance. It's not particularly useful to condemn speculation as gambling because a lot of legitimate and useful investing is very risk-tolerant. A much better heuristic is whether or not it's an individual or a firm engaging in the trading.