I think you should rewatch those scenes again. It's never stated that Sandman would die (or Lizard, for that matter). Osborn and Doc Ock find out that they'll die, and Electro realizes that he was about to die. Lizard asks Electro if he is going to d, but Electro never has a chance to answer.
Sandman isn't helping the bad guys at the end. He wants to push the button and go home. The bad guys want to destroy the button so they don't get sent back to their deaths. Spider-man is risking Sandman's ability to go back home, because Spider-man refuses to press the button. Sandman doesn't care about the fact that the bad guys will die (after all, they are bad guys), whereas Spider-man does. Hence they are at odds with eachother.