Why wouldn't Obama be elected VP in this scenario?
It's only theoretically possible. The only way this would have happened is that each Democratic member + some Republican members of the EC agree upon electing Obama VP, while
not voting for him as President.
I just realized there is a second way: Obama gets more votes than Biden in the EC as VP and the Senate (including at least two Republican members) agree on Obama. But that would split and destroy the Democratic party.
In the OP I took for granted that some members of the EC or of the Senate wanted to preserve the Office of the Vice President from harm...
Also, didn't Democrats take control of both the House and Senate in 2008? Why would they elect McCain?
It's just a scenario. As there is a tie in the EC, the GOP might therefore has won the lower chamber.
As far as I know, it doesn't matter how many seats a party has won in the House of Representatives, it is important which party has a majority of states with a majority of members of their party.