Trump has spent the last two months telling the world that the election was stolen from him; he spent the six months or more before that telling the world that the election *would be* stolen; and he spent most of the last few years, including long before his presidency, telling the world that every other media source was fake news and the "enemy of the people".
After a while, people are going to take him seriously. A few hours before the riot, he spoke to a crowd, telling them that,
"we're going to walk down Pennsylvania Avenue... we’re going to the Capitol and we’re going to try and give...our Republicans, the weak ones... we’re going to try and give them the kind of pride and boldness that they need to take back our country."
No. He hasn't just "behaved badly". For a moment, he was trying to force a coup. Incidentally, even in that short snippet he lied to the crowds: note the use of "we" from a man who promptly disappeared and watched the ensuing chaos on TV in his living room.
Stop defending Trump. This was his doing. Even though I doubt he had any idea of what he was about to unleash, he was still the madman who fed the monster and let the monster run riot.