ridiculously bad management by MS. WinPho looked like it had a viable future whilst nokia still existed separately. WinPho 8 on nokia hardware really wasn't that bad of a combination. If microsoft had only kept the nokia name, released the phones they had in development with winpho8 on them (until 10 was ready) then there probably would have been a future for that division.
More of the same might have worked. Instead they decided to screw it up every way possible.