Open source has a lot of momentum in Microsoft now but it wasn't the case when Windows Phone was released.
Had they made it open source, it would have been a different story with Android and Windows Phone fighting to win the OEMs.
But that ship has sailed. Unless there's a paradigm shift in smartphones (doubtful), we're stuck with Android and iOS for the foreseeable future.