Erm, dude, like others have suggested, read the Koran. When you put his actions into historical perspective with what the Koran says, it actually makes sense as to why he did what he did.
Growing up, I attended a church who was insistent in putting the Bible's passages into historical context. And for good reason - even if it is the word of Allah, or Jesus, or God, its still effected by biases of the people who recorded it (and, not to mention, translations, thats another thing).
Muhammad was, after all, just a human, subject to every single weakness that humans have. Yeah, he was the greatest prophet ever according to Islam, but he was STILL a human.
If you expect a human to be perfect, you're joking yourself. Tis one of the many problems I have with Christianity, but alas, lets not go there at this point in time.