"Why can't they do it right?"
"If Apple had released the Mac OS to PCs in the early 90s, we'd have more than one OS to choose from for our PCs."
Until OS X the Mac ran non-portable code (initialy 68K, then PowerPC). It would have been a major engineering effort to make it work on Intel at that point, and when Apple did try licensing to thrid party (PowerPC) manufacturers it was a disaster.
"If they had allowed competition when they tried it in the 90s, we'd have all sorts of Mac designs to choose from."
see above. They tried it, it didn't work out.
"If they would sell the iPhone unlocked to third party software we'd have a beautyfull platform to develop mobile applications for."
but they probably wouldn't be able to get it through FCC approval. The iPod Touch IS unlocked, because they don't need approval for that.
"My point is that if they had done what the market wants to buy, they'd be in a much better position right now. Even though they are doing great."
They appear to be doing what the market wants, which doesn't always equate to what techies want.
"Competition is good. I take as proof the sorry state of the Windows OS."
MS do seem to need a kick up the backside, but the problem is how do you get any other OS up to critical mass? People buy software not opperating systems. A PC + OS is just something that runs the software that they want (be it games, graphics, office or whatever). Developers write software to make money (mostly), so they write for the platform that has the most users, or at least enough users to make it worth while. With 90%+ of the market Windows is the obvious first choice.
"And by the way, they should have built OS X on top of BeOS not BSD"
They looked at BeOS, but NeXTSTEP interface on BSD beat it. BeOS was even more propriatry than OS X BTW.