I think its because people judge the debate differently. In a classic debate settings, where facts are argued, points are giving for using correct information and logical arguments, the outcome is obvious. But a lot of people dont think like that, and probably never have. Good orators win elections. People want to "feel" comfortable with the person they are voting for in an election. They want to know they "can have a beer" or "does this person let me wear a cap backwards." Sure, its part simian behavior, but it also speaks to a great truth, that people like to feel safe. With Bengazhi, the emails, the killings, the health issues, people dont trust or feel safe with HRC. The advantage Trump has, is he has never been in a position to really let a mass populace down (yes, I can list his bad business dealings from not paying taxes to Trump University).
Trump speaks well. He is a master orator. While he may not know the answer, people like his confidence, his power. Even without the presidency, Trump is probably one of the most powerful people in the world. And that does have some weight. Every great leader has been someone who can speak well and inspire. Bush II wasnt the smartest guy, but when he spoke, you were drawn to him. Clinton and Reagan had same thing.
Obviously, you can argue Trump appeals to the masses, he represents a lot of people that feel like they have been shit on by current politics. You know that Trump will go to a fight to win, not back down to Iran/UN/Russia, etc. People are desperate for a hero. Now, Trump is no hero, and in people's darkest needs, they will take him, but its the best option for many.
People wanted to try and like Clinton in this debate. She killed him on facts and points, but Trump came off more human and more likeable. And thats all he needed to win.