You're wondering if it's legal to engage in a DietBet.
It is. Let's start with the legal definition of gambling (in the US):
A person engages in gambling if he stakes or risks something of value upon the outcome of a contest of chance or a future contingent event not under his control or influence...
Gambling fundamentally involves betting on something outside your control or influence, like the Packers winning on Sunday, or on a contest of chance, like the spin of a roulette wheel. DietBet is neither. There is no luck involved in whether you win and your weight is entirely under your control (hard as that may be to believe sometimes). It is the textbook definition of a skill-based contest.
Furthermore, because DietBet is not winner-take-all like The Biggest Loser TV show, there can be multiple winners in each game. Indeed, everyone in the game can win (in that case, everyone gets their money back). It doesn't matter if someone else in your game loses more weight than you, or loses weight faster.
In the end, DietBet is just a healthy race against the scale with money as an incentive.