When you actually calculate the cost it takes to make an imac, apple only makes a small profit on each machine, and apple can't afford to give away computers at a cheap price because they don't sell enough, if you look at a comparative PC company such as sony, the prices are around apple's and even exceed it, apple produces high quality computers, just like sony.
To the OP - I recommend you spec out a Dell to match (as best you can) the Apple product of your choice. I think you'll see that once you get everything on the Dell on par with the things Apple puts in their computers that they come out to roughly equal. The Apple will sometimes cost more, and sometimes the Dell will cost more. C'est la vie.