There are all sorts of reasons why getting a book published can take a long time.
There is, for instance, the matter of copy-editing, so that you'll have a clean, professional manuscript. Copy-editors are often freelancers who work on a case by case basis, and sometimes for more than one company, and the good ones are naturally going to have full schedules -- and so you have to wait until they're available, or go with somebody who may not be so reliable. Bad copy-editing can be very bad indeed (and cause a lot of headaches for the author), so it's worthwhile to wait until you can get someone you trust rather than just anyone who promises a quick turnaround.
Then there are the endorsements by other authors, the so-called blurbs. You send the manuscript out as soon as it's revised (but not yet copy-edited), but you're asking these other writers to do you a favor (for free) and to take time away from their own projects and their own lives to read the manuscript and write up a blurb. Obviously, you're in no position to ask for a quick turn around; these people have to be given enough time to fit you into their schedules. So that's a few months right there.
Another factor is reviews. In order to be most effective, a review needs to be published around the same time the book first comes out -- either slightly before or slightly afterward. But reviewers have their own schedules and deadlines, and you need to get the advanced reading copies to them at least a couple of months before the pub date.
These are just three of the things that have to be built into the publishing schedule, and there are many more besides -- some of them overlap, some of them have to be done in order, some of them have to be approved or commented on by several different people or departments (including the author) and a problem or a delay at any point could throw off the whole thing, so you can't schedule things too tightly -- you have to figure in a little extra time so that you can be flexible as necessary.