For a Unix-centric company that owns Symbian, Maemo/MeeGo and Qt, whose flagman product (not to mention the long awaited N9) was running Linux, and that was hiring Java/C developers hard in the last year, this news is more like a suicide committed in public.
I personally see two explanations of this weirdness. The first one is the huge HTC profit leap which could make Nokia naively think that Windows Phone could do the same to them. This assertion appeared to be beyond investors' comprehension and Nokia stocks instantly slumped 15%.
The second one is more realistic. I don't know how long it will take Nokia to adopt the Windows platform, but in my understanding it could take years.
But then I thought about Qt and its acquisition by Nokia... Then I remembered the MySQL acquisition by Sun...