Apple and Yahoo formed a special agreement when the iPhone was first launched in 2007 that gave "push" (in this case IMAP) email capabilities to iPhone, thus giving you free access to Yahoo's exchange services. Unfortunately, the agreement did not extend onto Mac products, and thus, does not extend to Mail.
Keep in mind that you can use Yahoo's POP3 server settings without paying extra. The limitation of POP3 vs IMAP is that changes are not synced between the device and the server.
If you're interested in an email service that provides free Exchange or IMAP service across all devices, I suggest giving GMail a try.