there are a litany of things you are legally able to do outside the workplace that are not allowed inside the workplace. alcohol and gambling are just one of them. no porn viewing at work for example. some companies dont allow you to view ANY internet sites at work.
the nfl obviously has concerns about their players gambling given the nature of their business and the perception of competitiveness.
also, im sure this is in the cba, which means the players themselves agreed to it.