The primary distinction between gambling and non-gambling is whether something is a game of chance, and usually, the statutes of a state prohibiting gambling will expressly define it in those terms.
The mere fact that there is some element of chance or probability involved, however, is not sufficient to make something gambling, and the fact that there is some skill involved in a game does not automatically prevent it from being gambling.
Generally speaking, if the activity serves some commercial or economically useful purpose, like an insurance contract entered into by someone with an insurable interest in the outcome, or a contract regarding a security or commodity price, it will not be treated as gambling under U.S. law (Britain and Ireland draw the line differently).
The status of prediction markets is still unresolved, but since many of them call upon the application of skill and knowledge, rather than random chance, to make predictions, and since their use, for example, by the CIA, has given them an air of legitimacy, more often than not, they are not treated as gambling.
Binary options are regulated in the United States by the CFTC and gambling is regulated by each U.S. state individually.
This isn't entirely true. But it does appear that the CFTC asserted jurisdiction over this particular prediction market type activity, and did not consider it to be gambling subject to state law regulation.
Also, there is some federal regulation of gambling even though it is primarily a matter of state law.
Indeed, this ruling was quite helpful in the long run to the prediction market industry. The case held that Polygon.com was subject to CFTC jurisdiction, which would take it out of state law gambling jurisdiction and it provided a road map to come into regulatory compliance:
The platform offered off-exchange event-based binary options contracts and failed to obtain designation as a designated contract market (DCM) or registration as a swap execution facility (SEF).
All it has to do is register with the CFTC as a DCM or SEF and it is in regulatory compliance (these aren't trivial undertakings and could require months of interactions with the agency and $100,000+ of legal work to accomplish, but there is a clear path to doing so).
does it mean that if a company creates a question (Yes/No) on financial assets (like an option traded on an exchange) will be considered as a binary option regulated by the CFTC while a non-related financial question is considered as gambling?
No.
The case held that the questions, for example, about who would win the next Presidential election, constituted a "swap" regulated by the CFTC and not gambling. It simply said that since the CFTC has jurisdiction and since Polygon.com had not complied with CFTC rules for conducting that activity, that it had violated the law.