Setting a limit is very important, there are gamblers that claim to gamble only for entertainment but they end up spending recklessly and taking high risks all in the process of entertaining yourself. Gambling is all about taking risks but as a smart gambler its better to take reasonable and calculate risks instead, like you said, whenever we go beyond our limits it no longer becomes and entertainment to us
In fact, in this case, one thing that is most important is our own mental control, if we accept gambling only as entertainment, then maybe we will turn off ourselves while doing such activities.
But if it happens that we see gambling as a source of getting rich, then the greed inside us will not allow us to maintain self-control, and later even if we set a loss limit, someone can break it and top it up again and gamble. And this is how we see various gamblers gambling even with loans. So, to avoid being on that list, we should control our mind while gambling along with limiting our budget.