The president "had to know" that the bill would be soundly defeated in the House. So, why is he so mad? Especially, why is he mad about something that was certain to fail from the start?
The House is controlled by the Republicans; the Senate is controlled by the Democrats. Therefore, if the bill was successful in the Senate and, then, defeated in the House, then the "blame" could be fully ascribed to the Republican party. This, I believe, was obama's goal from the start.
Why would such a goal be desirable? To influence the 2014 elections in favor of Democrats. Obama desperately needs Democrat control of the House (in addition to the Senate) to bring to fruition his socialist goals for America.
Had the Senate passed the bill and the House reject it, the story would be simple going forward. "The Republicans are the ones who do not want to keep you safe!", and other such. But, now that "dog won't hunt". Obama's strategy has gone by the wayside.
That's why he is so angry. And, he displays the normal maturity and logic of the average 2 year old who doesn't get their way.