There's really no reason to hoist a three when your team is down significantly more than three points with the time about to run out. However, you might want to in order to make to look as if you're trying to make the game closer, even if it's practically impossible to actually make the game meaningful.
That's probably what James Harden was thinking when he threw up a three even as his team was down six with no real chance of the Thunder coming back to beat the Spurs. But his three was meaningful to gamblers: the Thunder were five-point underdogs, and considering they were down six, and ended up down three.... well... somebody in Vegas is probably pretty angry at Harden. On the plus side, hey, his three-point percentage went up a bunch because he hit that shot!