Of course, it depends on the situation and the situation also depends on the person's point of view, or that means everyone has a different point of view and decision in every situation, even though according to them it is good to choose but maybe for other people it is not recommended and should be avoided.
Yes, some may think that gambling is work is wrong while others may have a different point of view. I think as long as you can balance between the office work and gambling, and the office work is not compromised because of your gambling, then it may be on to gamble at work.
Basically it is very dangerous if someone already thinks or assumes that gambling becomes a necessity, such ideas should really be avoided, after all this is gambling which is more famous for its negative impacts than the positives that we can hardly get. Although different points of view are always a certain thing in every individual but they should be able to feel if indeed their point of view is wrong which causes them to get involved in some problems, especially financial and that should be an indication that their point of view and way of thinking on gambling is wrong or not right.
On the other hand it is true, that as long as they can balance everything well especially in terms of time and finances and also do not interfere with work activities then maybe it will not be a serious problem, but basically only one thing I would say is that dividing time wisely according to its portion is better to do.
Actually from the two things you mentioned that might be an option / chosen by others basically in common sense both are really bad actions, especially if you do it when you are focused on doing other things, especially in the workplace that provides you with income to survive, no matter whether it's alcohol or gambling or even illegal drugs which basically have a negative impact all of that should really be avoided, there is no reason that makes sense with whatever they say for a defense.
Office work give you income and you should not compromise of the office work because of gambling. Sometimes you complete the office work and have time, then you can gamble. but if there is a pending office work and you start to gambling, and ignoring the office work, then it is not only unethical but also you are not faithful to your job and duty.
If all that goes well or that means it is still in a safe situation even though you are doing work and gambling at the same time but on the other hand there are still consequences that should be worried about, it is your main job which of course as I said earlier that it is the income that finances your life, so from this alone they should be able to consider which is more important and which is not necessary, after all there is still plenty of time for you to gamble right? You can still engage in gambling when all your work is finished, or that means when you go home and you can gamble at home in a relaxed and calm situation. If you persist in gambling at work then obviously the risk is that you might lose your job if your boss finds out about the activity.