Preventing root access provides a number of advantages for the carrier and hardware manufacturer.
The most often-touted benefit is security. Without root access, a malicious app (or a user who over-estimates their technical abilities) can cause your personal information to be accessible to third parties, reconfigure the hardware/OS such that the device is inoperable, or perform actions that cost the user money without the user's knowledge (for example, an app that secretly dials overseas toll numbers and racks up huge charges). Locking the user and their apps into a limited-rights user account makes these types of problems much less likely to happen. This is the same reason why your user account on a desktop PC is most likely not the system administrator account. By helping prevent this source of problems, the carrier and hardware manufacturer eliminate a wide array of customer support calls and (more importantly) improve the public's perception of the quality of the device and service (since a "virus disables thousands of Motorola Droid phones" headline makes Motorola look bad, even if the virus is to blame). Depending on locale, this might also open up the carrier or manufacturer to legal liability in some cases, such as the identity theft of a user by malicious third-party code that was running as root (and doing things that the device was not even attempting to prohibit).
Another reason is contractual. Many phones, when they are first released, are only available to certain carriers for a period of time. Those carriers pay a hefty premium for their exclusive access windows. If a user could freely root the device, it would be easier to modify the phone for use on other networks, bypassing the exclusivity that the carrier paid so much to ensure. If the phone manufacturers didn't take reasonable steps to make it difficult to do this, then carriers would be much less likely to enter into an exclusivity agreement, which means the manufacturer would lose the extra money that such an agreement would bring.
Rooting a phone can also give the user information about and control over the hardware that the device manufacturer never designed them to have. When the user has limited permissions, device testing gets much simpler. Anything that requires root access can skip detailed user tests and safeguards because only the static system software will be able to access it. Also, some hardware makers use "tricks" to reduce manufacturing costs that could damage their profitability if widely known. For example, some companies that sell multiple versions of a particular product (such as a "light" and a "normal" version) actually use the same hardware in order to save manufacturing and inventory costs. The "light" version would use the firmware/software to under-clock the hardware and disable certain features, making the device appear to be a different hardware model. If the customers discovered this and had root access, they could buy the less expensive "light" model, patch the software to remove the hardware-limiting features, and end up with the more expensive model of phone for the price of the cheaper model. I remember having a CD-RW drive that did this; once someone discovered that the slower, "budget" version of the drive could be converted into the faster model by software, it was only a matter of time before a hacked driver was released that "upgraded" your drive and saved a lot of people about $40 by not having to buy the more expensive model.
Sometimes, firmware/software can contain inactive, incomplete code that wasn't finished in time to make it into that release. Some of this code may refer to features that have not been announced or technologies that have not been fully patented or have not passed the appropriate regulatory tests. If a user has root access and can activate this code, then the phone manufacturer runs the risk of being held liable for disclosure of trade secrets, selling devices that do not meet regulatory guidelines, etc.
Some carriers and device manufacturers get paid to periodically "push" content onto your phone. For example, several people I know all had a "Watch NFL Games Live" application suddenly appear on their Blackberry devices one day. Whoever created that app paid to have it force-loaded onto customers' devices, and these "content-pushing" fees are an important revenue stream for many companies. Giving the user the ability to disable the remote loading of content would shrink the number of users exposed to the media in question and thus reduce the fees they could collect from the content creator.
And of course, root access is blocked to ensure that proprietary revenue streams remain intact. If you sell an app in the Android market, Google receives a commission of the sale price. If a phone was easily root-able, the Marketplace app could be replaced with a version that is run by another company that collects slightly lower commissions. Google uses the Marketplace income stream to fund Android development (among other things), and losing their "app store" traffic could change Google's mind about the idea of an open-source smartphone OS. Similar profit motives also exist from the carrier's point of view, as other answers here have mentioned (dis-allowing apps that replace services that the carrier charges extra for, etc).
All that being said, I still don't like the lengths to which manufacturers go to prevent users from having any real control over their devices. I understand why carriers and manufacturers want to lock down devices as much as possible, but if I find a bug or a badly-designed part of the software and fix it, what's wrong with letting me run the fixed version on my own phone (provided that I'm made fully aware that I won't receive any official support, and there's a fast, easy way for customer support to detect modified software)? For example, you may be familiar with a Windows utility called TweakUI. This app adds an extra control panel that gives the user control over a wide variety of system settings that they would otherwise be unable to change. If a power user wants a higher degree of configurability, they can download and use this utility. A normal user would not need such a tool and would not install it, safely preventing them from accidentally mis-configuring their system. Why not have an official "advanced tweaking console" app that can give similar advanced setting to power users. In many cases, this could give the user the extra capabilities that they would normally root their phone for while still retaining the benefits of running as a non-root user.