The apple licensing is on both the hardware AND software together, when a person buys the hardware they are entitled to use the software and it subsidies the cost of the software, hence why its a hell lot cheaper.
Many companies have tired to get OS X on there generic hardware and failed, making up all sorts of excuses, but they just get law suited.
Think of it this way (playing devil's advocate here). There is a giant community elsewhere on the net that dedicates a lot of time into making OS X accessible to those who would not otherwise use it/buy it. Including numerous anti-piracy checks in their installer to make sure only genuine buyers are able to get it working. That money goes to directly to Apple, which would normally not have made them any profit as some of their current line-up of Macs are just too lacking at the moment (just look at the whole debacle with the Mac Pro and it's exclusion from the EU). I'm sure if Apple actually updated them more than every 3 years then power users may be more tempted to buy genuine hardware but as it stands it's terrible value for money.