And their UI (mobile and web) still suck for lesser used features to this day. Not the "doesn't look good" kind of suck, but "they forgot to put in the submit button" kind suck.
Let's exclude Apple and Google from the competition because they own the mobile platforms.
Windows CE 4 was way ahead of iphoneOS 1, 5 years earlier.
In 2007, Facebook was way, way less mighty, and by 2012, it was late.
Speaking of Windows Phone: it had great hardware and good, innovative software. It's Microsoft's bureaucratic ineptitude that killed it, not its (possible lack of) merit.
Before that, we had things like the danger hiptop and blackberries. Incomparable.
What do you mean Nokia with Tizen? Tizen was Samsung's attempt at continuing with Linux after Nokia abandoned MeeGo.
Nokia was the massive smartphone market leader with Symbian, but was a hardware company at heart and couldn't keep up with Android which ate its lunch by giving all the competitors a free, competitive operating system.
Before Android came along the competition didn't really have much choice as they were even worse at software than Nokia was. Who knows, without Android the landscape might still today be Nokia & Apple sharing the market -- or maybe Windows Phone would've managed to become the second system.
They had Windows CE in the 90s, and Windows Mobile in the 2000s.
They were in a good place to be able to release a smartphone in time.
According to reported stories, Bill used to be really good at understanding how to squeeze the last drop of performance from slow hardware, a vital skill to have in the 1980s, yet subsequently became less important when desktops became fast enough. If they had Bill Gates leading the technical direction of the mobile OSes, the extra focus on speed optimization might have been what would have allowed Microsoft to do better during the smartphone wars.
All speculation though.
I'd say that it's the moving too slowly and not focussing on getting some key apps working on WinMobile did not let the platform win some mobile.