Answer:
Because 'legal' gambling means that the State you live in has legalized various forms of it in some way. Basically all states have legalized gambling when its their own Lotto system.
But there is no Federal law against gambling. That is why so many Indian reservations have casinos.
As for riverboats, they are actually a boat that is on an international waterway and so are subject to Federal law but not the state law since they are not ashore on any state.
They build huge hotels and restaurants and stuff right next to the shore then have one hallway that leads to a riverboat. So when you walk from the buildings to the river boat, you hardly recognize that you did.
In states like Nevada, the casinos just build their casino on the ground because they are allowed by the state.