I personally think they go overboard in the name of security on iOS, for example the banning of JIT and (formerly) dynamic libraries combined with the App review process is overkill. You don't need both.

BUT...context of where this all stems from is important to remember. On the Mac side before the iPhone, the Windows world was getting hammered with security problems and the perception of this was having negative repercussions throughout the PC world. Average users were scared to touch their PCs and especially afraid to try installing new applications. Mac users were the complete opposite of this and their market was dominated by consumers who loved getting (buying) the latest OS updates and buying the latest, coolest apps. Money flowed in the Mac world. But as Mac started getting more attention, lots of different press coverage wondered if Mac could be vulnerable to the same kind of vulnerabilities Windows users were constantly dealing with now that it is a bigger target. So keeping Mac secure for the benefit of their users became a profit incentive for Apple.

On the iPhone side, remember, Apple was walking a tightrope with the phone carrier (AT&T) when they first got started. They didn't have the leverage they have now. Remember that mobile carriers have been obstinate about updates in the name of (their own) "security". They didn't want a bad update, that they couldn't test, somehow bring down the entire cellphone network. Nor did the carriers want nefarious apps that would secretly make expensive phone calls to pay-per-minute numbers. It's no surprise that when Jobs finally was convinced to open the platform to 3rd party native apps, there was some kind of vetting system introduced to appease the mobile carriers from saying 'no'. This is not to say that security was the only thing on their mind and there are other reasons they would like the model they have, but it was a factor. (Consistent user experience is another factor, which is something the App Review process could help enforce since the iPhone was new. Mac has less of this problem because there had been many years of conventions laid down which developers were very good about following in the eco-system already, which is another key difference between the iPhone and Mac ecosystems.)

As for why Apple doesn't lock down the Mac as they do now, the simple answer is that it doesn't help their bottom line in any way. Mac and iOS have very different use cases and heritages. And Apple has been successful with their current Mac carrot/stick trade-off. Most Mac developers I've talked with say that while dealing with the Mac App Store is annoying, they do get a lot more visibility and sales than by not being on the store. Users are no longer confused about how to "install" their apps which saves them customer support costs. (Yes, the open DMG, drag-and-drop to Applications thing is confusing for people.) For indie developers, building a store front and dealing with a payment processor doesn't save them a huge amount of money for what Apple provides for their 30% cut. And remember, sales seem to be better on MAS for most developers so this ends up paying for itself. (And if you are a game developer, you see basically the same arrangement with Steam/Value.)

For those who can't get on the Mac App Store, perhaps due to the technical restrictions, Developer ID for GateKeeper is one option. Apple still gets $99/year for this. And it is worth pointing out, if Apple was truly only obsessed about their 30% cut for MAS, they wouldn't have these technical restrictions and would let anybody do anything on MAS so they could get their cut.

So if Apple decided to lock down the Mac entirely, what does it get them? Most developers are already voluntarily using Mac App Store and Developer ID. Those developers who are not already participating in those systems and not giving Apple money, locking down the system isn't likely going to get any of these developers to hand over any more money.

A lot of these developers are probably making software for their own in-house purposes, developing web sites, or developing for Android. Apple locking down these use cases would only result in people moving back to the PC. And internally, this would probably break all of Apple engineering as they all work on operating system components which don't fit the lock down model either.

And most importantly, remember that Apple's gross margins on hardware is like 40%. If we're talking about chasing customers away, that's a lot of money to lose. Who cares about the cut on a freebie flashlight app, website, or command line tool, which isn't going to make any money, compared to the profit on selling all those $2000 Macs.