Is it bad when my iMac is constantly on?
Solution 1:
No, it's fine. The CPU's heatsink may warp over time (unlikely unless there were QA problems to begin with like some in the first generation MBP) and reduce the transfer of heat, leading to thermal thresholds being reached and the system shutting down.
Some may claim excessive fan wear, leading to failure, but I ran the stock fans in my 2006 MBP at 6,000 rpm for over a year without problems—they are quite resilient and I suspect RPM throttling hurts them the most, not constant spinning.
Other issues some might find distressing would be hard drive wear (again unlikely as heads are often parked if not in use).
Truthfully, the only surefire downside would be the increase in power draw, but other than that, no, no ill effects or failure to hardware will occur.
Solution 2:
Modern macs are designed to run and properly cool and maintain themselves during constant use.
When everything is working, you are keeping the air around the mac within spec, airflow is not obstructed, the temperature sensors will detect and monitor high heat generation if the software has everything going 100%.
The hard drive can be put to idle when it's not in use, the screen can dim and sleep, the fans will go to idle when the internal temperature is low enough.
There are many causes of failure - some are simple wearing out, but others are related to thhe start and stop. I have had machines that run in a server room for 5 to 8 years always on. By running all the time, you increase some modes of failure that whereas turning it on and off all the time causes other modes of failure to be more alike.
To be more specific, in the past, some generations of hard drives have had lifetimes in the tens of months (seagate, hitachi, IBM, WD all have had a bad crop or two but fixed it once they realized they had a design or manufacturing issue) and the displays (CRT and CCFL/fluorescent lit primarily) wear out due to use. The thermal stress of on/off temperature changes seems to hit CPU/GPU and power supplies harder than just letting them run.
Keep in mind, your mac is priced and assembled from some of the best components and the lifespans of macs are statistically among the best in the industry.
These odds are very low of these failures in my opinion - we're talking one or two machines out of a hundred or more. Having had many repairs - treating the mac well with clean power and a cool room is all that matters to me.
There are great reasons to allow your mac to sleep by saving scarse energy, generating less heat, the reality that a monthly reboot or more is helpful to the many people that use a wide range of software (especially non server software - it takes great effort to ensure software is stable enough to run for months or a year at a time and to always clean up after itself properly).
I look forward to reading other people's take on this. I feel it's a wash - the hardware benefits of controlling between aggressive sleep / off and always on are minuscule and not even statistically significant favoring one approach over the other.
Solution 3:
In addition to @cksum's excellent answer about hardware not really being affected adversely, I feel compelled to advise that, from a software standpoint, it does make perfect sense to reboot your Mac every once in a while. Doing so gives systems, processes, and the like a chance to start fresh, and reduces the chance of there being weird problems. Per my answer to a somewhat-related question, I reboot my Macs every Monday morning when I come into work. Beyond that, I only reboot when something fatally crashes with The Beachball Of Doom. I rarely have problems with the OS or the Mac itself since I started the weekly reboot. YMMV