Apple built a phone to build a better phone.
Google built a phone to make sure they had a solid foothold in mobile ads and the mobile web in general.
Microsoft built a phone for mobile ads and to ensure that their enterprise applications had a mobile experience that they controlled, so no one would switch to a different application because it had better mobile features or support. It should be noted that Microsoft's efforts are failing, though their tablet will probably see some success. (EDIT: That's clearly not the reason why Microsoft built phones in the first place, but I think it's a solid justification for why they still care. Windows Phone is a money loser thus far.)
Facebook doesn't have a phone. They're rumored to be building one. I don't understand why it's a good investment for them when their apps are on every phone, with contacts integration on iOS.
Amazon is rumored to be building a phone, but I don't understand the logic behind it. The only reason they have a mobile OS is because they needed a device to push their content to.
Other than advertising, I don't see a good reason for Yahoo to start building devices that are any more involved than throwing some Yahoo apps on top of Android. If they built something incompatible with an existing mobile OS, it would fail.