You do not understand politics, which is not surprising, since you do not understand much of anything else, either.
When Obama was a senator, there were different factors working.
(1) Obama knew that his vote would not prevent the debt ceiling from being raised.
(2) Obama voted as he did to express opposition to the unnecessary war that Juniorbush had mongered.
Some votes are for real, others are for political posturing. Both parties do this.
Would I have voted against the debt ceiling when Obama did? Probably not. I am not a politician, nor do I want to be one. But being as this vote resulted in no consequences, and Obama knew this when he voted to show his political opposition to the war, it was far less important than the fact that Obama was clearly a better choice than McCain, and still is.