The Talmud discusses the disqualification of a dice-player (מְשַׂחֵק בְּקֻבְיָא) from giving testimony, debating whether the reason is that he engages in a form of quasi-theft (asmakhta, since neither party seriously commits) or because he is not occupied with the 'settlement of the world' (yishuv ha-olam). This is the foundational sugya for all subsequent halachic discussion of gambling.
מַתְנִי׳ וְאֵלּוּ הֵן הַפְּסוּלִין: הַמְשַׂחֵק בְּקוּבְיָא, וְהַמַּלְוֶה בְּרִיבִּית, וּמַפְרִיחֵי יוֹנִים, וְסוֹחֲרֵי שְׁבִיעִית. גְּמָ׳ מְשַׂחֵק בְּקוּבְיָא, מַאי קָא עָבֵיד? אָמַר רָמֵי בַּר חָמָא: מִשּׁוּם דְּהָוֵה אַסְמַכְתָּא, וְאַסְמַכְתָּא לָא קָנְיָא. רַב שֵׁשֶׁת אָמַר: כֹּל כִּי הַאי גַוְונָא לָאו אַסְמַכְתָּא הִיא, אֶלָּא לְפִי שֶׁאֵין עֲסוּקִין בְּיִישּׁוּבוֹ שֶׁל עוֹלָם. מַאי בֵּינַיְיהוּ? אִיכָּא בֵּינַיְיהוּ דִּגְמַר אוּמָּנוּתָא אַחֲרִיתִי.
MISHNA: And these on the following list are the ones who are disqualified by the Sages from bearing witness due to their unseemly behavior, as they are considered wicked individuals guilty of monetary transgressions: One who plays with dice [bekubbiyya] for money, and one who lends money with interest, and those who fly pigeons, and merchants who trade in the produce of the Sabbatical Year, which may be eaten but may not be sold as an object of commerce. GEMARA: With regard to one who plays with dice for money, what is he doing that disqualifies him from bearing witness? Rami bar Ḥama says: He is disqualified because gambling is a transaction with inconclusive consent [asmakhta], as one who gambles does not have conclusive consent to pay when he loses since he plays under the assumption that he will win. And as an asmakhta does not effect acquisition, the one who wins takes money that is not legally his, and is considered a robber. Rav Sheshet says: Any case like this is not an asmakhta. In a game of dice both sides realize that they might lose, and consent at the outset to pay if that happens. Rather, those who play dice are disqualified because they are not involved in settling the world, i.e., in productive occupations that demand hard work. Since they do not realize the effort required of most people to earn a living they might not be scrupulous about other people’s money, and their testimony cannot be relied upon. The Gemara asks: What is the practical difference between the explanations of Rami bar Ḥama and Rav Sheshet? The Gemara answers: The practical difference between them is in a case where the dice player learns another occupation, and is involved in that occupation as well. According to Rav Sheshet, since he has a productive occupation he is fit to bear witness. According to Rami bar Ḥama, since he is considered a robber, as the money he gains from gambling is not legally his, he is disqualified.