It's legal because no major industry has turned their lobbying efforts on outlawing it yet. There's no clear philosophical line between gambling and, say, investing.. there's just (decreasingly) moral crusaders and (increasingly) interests who profit from keeping things illegal outside of their personal holdings.