How is it possible that these startups are legal when sports gambling is illegal in states outside Nevada, Delaware, Montana, and Oregon?

It's because fantasy sports is considered a "game of skill."

In 2006, the federal government passed a law called the Unlawful Internet Gambling Enforcement Act that established fantasy sports as a "game of skill" and not a "game of chance." The law says it's legal if it:

(I) is not dependent solely on the outcome of any single sporting event or non-participant's singular individual performance in any single sporting event;

(II) has an outcome that reflects the relative knowledge of the participants, or their skill at physical reaction or physical manipulation (but not chance), and, in the case of a fantasy or simulation sports game, has an outcome that is determined predominantly by accumulated statistical results of sporting events, including any non-participant's individual performances in such sports events

In fantasy sports, users put together their own teams using real-life players. The outcome of the game is determined by how each player on a user's team performs, accumulating points based on real-game performances. The law is classifying this as a form of game in which actual skills matter to win.

That's a debatable idea. But regardless of which side you sit on, daily fantasy-sports sites are legal under today's laws and they will continue to flourish, racking up hundreds of millions of dollars in revenue. FanDuel reportedly generates nearly twice that of DraftKings. It brought in about $57 million in 2014 by taking a small percentage of the betters' entrance fees. Both companies spend a lot of money on advertising, though, and are not profitable.

Here's how Draft Kings explains its legality on its website:

The legality of daily fantasy sports is the same as that of season long fantasy sports. In 2006, the US Federal Government passed a law called the Unlawful Internet Gaming Enforcement Act (or UIGEA), which was designed to prevent gambling over the internet. The law included a carve out that clarified the legality of all fantasy sports...Daily fantasy sports is a skill game and is not considered gambling.