Politics and religion aside the *why* is easy:
Short answer: History.
Contrary to what some may believe, ebooks didn't start in 2008 with the appearance of ePub or even 2007 with the Kindle 1.
Long answer:
ebooks have been around since the 1970's.
And as technolgy has improved, the formats used for creating/distribution electronic editions of books has slowly evolved, leaving used with a dozen or so formats to deal with. Each format was created and adopted for very rational reasons and it is only recently that the choice of an ebook format has become a subject for acrimony and flame wars.
Before then, people understood why the formats exist and accepted that while the multiplicity is a pain, there is nothing personal about it. eBooks come in whatever format the creator had available at the time and if you didn't like it you convert it to one you like or look elsewhere. In the "old days" of three years ago, there was no feeling of entitlement as everybody knew and understood they were pioneers and "you can always tell the pioneers by the arrows in their backs". It was enough just to *find* the content you wanted in *any* ebook format you could use.
Really long answer:
The first ebooks were created to be read on time-share terminals. Usually VT100 or 3270s, connected to VAXes and IBM 360's and 370's. The first format was ASCII TXT with hard-coded line breaks, formated for 80-column displays which, after margins left about 60-64 characters per line. Look at project Gutenberg files and you'll see what the stuff looked like.
In the 80's PCs and home computers with bit-mapped displays arose and character formatting became common so RTF with support for reflowing tagged text became the format of choice as it allowed itallics, bold, centering, subscripts and superscripts, and even oversized text for headings. In the late 80's quality bit-mapped displays and laser printers became accessible and typography ceased to be the domain of the high-priests of publishing and pdf emerged as a document archival system so that highly formatted documents could be stored and distributed electronically in between printings. PDF was never intended as an ebook format but since it produces pretty pictures it was adopted as such in many areas right around the time when the first modern ebook formats were adopted. Unlike PDF which is primarily concerned with page layout rather than content (PDF doesn't know about words, sentences, or paragraphs just strings of characters; it *does* know fonts, sidebars, headers and footers) the modern ebook formats generally leave page formatting and typography to the reader apps and focus on document structure and content.
When the web brought HTML (a useful subset of the older but unusably unwieldy SGML) to prominence some sources adopted HTML as a more open alternative to rtf and PDF.
When the PalmPilot appeared in the mid-90's, bringing the first truly portable bit-mapped display computers to market, we saw DocReader, Peanut Reader (later eReader), iSilo, and Mobipocket bring to market ebooks in pdb variants and PRC format, all more or less based on HTML and XML. Other players of some note from the PDA era still float around in the fringes of the industry, like TomeReader's database-focused TBR format.
Shortly thereafter, Nuvomedia and Rocket Reader brought two market two promising but pricey readers that were frankly a decade ahead of their time. That gave us the rb and imp formats.
Round the turn of the century, the publishing industry realized there was a need for an *internal* common document format for books and after years of committee work, oeb (open ebook) was created as a common ebook format to be used by the big publishing houses internally. Oeb, however was never intended for consumer consumption; the idea being that retailers would wrap the oeb in proprietary wrappers and DRM.
First to market with a really good implementation was Microsoft who created created LIT format and paired it with a state of the art reader app (that sadly, has hardly been updated in 5 years yet remains ahead in onboard typography and presentation to most of the apps that have followed). By that time, Mobipocket had evolved their PRC format and the matching reader app (especially on PC) into a market leading reading solution and an actual market for commercial ebooks on PDAs and PCs developed. But, since PDAs were not as ubiquitous as cellphones and even notebook PCs weren't portable enough, some of the leading ebook vendors (most notably B&N) got out of the business. For a while Fictionwise and Amazon soldiered on beside other local and niche vendors but commercial ebooks were going nowhere.
Then the first eInk readers appeared to much acclaim for their screens and much disdain for the business model (only DRM'ed content allowed, it was absurdly priced, and purchases *expired*).
Amazon shut down their ebook store, which had sold LITs and PRCs, plus the occasional DRM'ed PDF...
...and bought out Mobipocket.
Sony brought out their second attempt at ebook Reader with the much improved 500 and 505 based on a propietary LRF/LRX format tied to a dedicated PC app much as MS Reader did.
Some asia-based reader devices adopted the WOLF format for reflowable text and the image-based PDF-like archival DejaVu document format. In eastern Europe, the FB2 format found a lot of traction for DRM-free ebooks especially when paired with the reader-friendly FBReader app.
By then it was 2007 and the first Kindle came out.
Like the Rocket Reader before it, it accessed a dedicated ebookstore without need for a PC. Like the Sony Reader, it used an eInk display and a proprietary variant of the Mobipocket DRM atop the latest version of Mobipocket PRC denoted as azw. For some ebooks (apparently not available in editable document form) kindle also brought the reviled Topaz (TPZ or azw2) format.
Six months later, an updated OEB specification--this time defining a LIT-like consumer-level wrapper standard--was introduced as ePub version 1.
Adobe promptly wrapped a proprietary DRM wrapper and Reader app and convinced Sony to deprecate their proprietary format in favor of Adobe-DRM'ed ePub, which they promptly licensed to dozens of vendors.
Adobe's DRM scheme, like Microsoft's LIT but unlike Mobipocket's and eReader's DRM, required (requires?) a PC-based app to feed the DRM'ed content to the reader. Because of Mobipocket licensing restrictions most reader gadget vendors that switched to Adobe's ADE ecosystem dropped support for Mobi DRM, rendering it primarily an App-based format for PCs, PDAs, and smartphones, much as eReader format.
When Barnes and Noble belatedly realized ebooks were a real business they bought out Fictionwise for access to their ebookstore, eReader format, and social DRM scheme, generally recognized as the least obnoxious form of DRM encumbrance extant. They then released their first Nook reader, trying to mimic as many of Kindle's features as possible and trying to add value wherever possible beyond that. In the process, they commingled the eReader DRM with ePub, to create a second epub DRM variant.
Six months later, Apple got into the game and they too wrapped ePub in a proprietary DRM-scheme producing a third incompatible ePub format. (I fully expect more ePub DRM variants. From China or France, for starters.)
This is, of course, hardly the end of the line.
ePub is still evolving (albeit slowly) and it still lacks necessary features like a standard dictionary format, a standard for annotations, and (probably) more standard rich-content extensions. So ePub 2 will likely be followed by ePub 3 at some point.
There will likely be a standard format or variant for proper academic ebooks for higher education and scientific use and it will hardly be shocking if an alternative format emerges from the floundering magazine industry.
In the rich-content ebook arena there are already two formats floating around the fringes; Blio's XPS-based one and Sharp's XMDF. More are likely.
Even more will come simply because technology marches on, change is constant, and no committee standard *ever* keeps up with either. As enook and tablet tech develops, the type and forms of content that migrates onto reader apps and gadgets will simply require their own standards and format variants. (Cookbooks, product catalogs, and children's books come to mind.)
Plus, the ebook universe is too big for any pantyhose solution; one size will never fit all.
Messy?
Yes.
But that's how emerging makets develop. Over time the legacy formats will fade away and a handful of maneageable leaders will emerge but it's early in the game and there is still too much content tied up in these legacy formats for any rational player to fully deprecate them. And anybody who thinks a universal standard of any real value will emerge is just deluding themselves. SGML tried and failed. Other attempts in other areas have met similar fates. No one can hold back the tide.
Best we can do is grin and bear it.
(And stock up on format-conversion tools.

)