When you're considering your prior experience it's important to distinguish between reasons why the job/environment may have been damaging to employees' mental health and reasons why people who may have already had poor mental health may have ended up working there.
Reasons why the Job may have been damaging
"The hours were really long and bizarre" - long hours bring a toll with them. There's a reason why so many jurisdictions provide legislation around maximum working hours, required breaks etc. Working hour patterns that are outside the "normal" (think Mon-Fri 9-5) have an even greater impact, they disrupt routines, homelife, socialization time etc. Particularly if the pattern is erratic, and even more so if you get into the impact on sleeping patterns of the more extreme shiftwork.
How to do better - ensure employees are getting sufficient breaks, time off. Keep hours predictable - or at least reasonably planned in advance to allow staff to still have some semblance of work/life balance.
"they were temps; and it was extremely difficult to get hired by the actual company." - sounds like a very precarious and insecure employment situation to be in. Which may not be a big deal - if the employee is not dependent on the income, or has a reasonable confidence in being able to get replacement employment quickly if it went away. Or if they weren't planning on staying long in the first place.
How to do better - provide a stable environment, be clear about the nature and planned duration of someone's employment, if you want a perm employee don't hire temps, hire perm staff like you would for any other position. Use temps where it's actually appropriate - i.e. the capactiy/headcount need is actually temporary for certain circumstance (e.g. seasonal peaks) and be clear about what being a temp means.
"aren't any dividers between each persons workspace and you can hear everything, everybody else is saying; which for some can take some getting used to" - while this is true it leaves out the fact that there are some people who can't ever get used to this level of constant sensory stimuli.
How to do better - this feels obvious but I feel it's worth saying anyway, provide dividers, don't pack staff in like sardines in a can. Provide non divided areas for breaks etc and keep them away from the actual workstations.
"he stress of having everything ready for stores opening up in the morning" - if there's a panicked rush to get everything ready every time then someone's got something wrong and it's probably not the support staff
How to do better - plan tasks around how long they actually take and how many staff members they actually need to get done.
"people on the calls getting angry" - you can't eliminate this entirely, people get angry and shout at support/helpdesk staff, it might not be right or fair, but it is what it is.
How to do better - Train the staff in how to handle it, how to stay calm and how to deescalate. Most importantly support them, give them clear guidance on when they can call in a supervisor/senior for help, and give them clear instructions on when they can just out-right terminate a call in the event that it's extreme. Make sure they know that you (the employer) have their back, and that they aren't going to get in trouble just because a customer started screaming and shouting at them.
"the occasional barrage of phone calls from an outage" - like the angry folks this can't be avoided entirely, to a certain extent it's the name of the game.
How to do better - As a business have processes in place to respond to this sort of thing - including quickly temporarily shifting capacity from other areas to help alleviate a pressure point where possible. Be clear in what messaging you want staff to convey during an outage. Make sure that staff who have had a deluge get some relief, breaks as soon as feasible, even if those are over and above what you would normally provide.
Reasons why people who may have already had poor mental health may have ended up working there
Honestly I think the fact that it was an agency job with crap hours, and likely not great pay - often people who have mental health difficulties are going to struggle more than those without to get/keep jobs, and to a certain extent may end up taking less desirable jobs that others wouldn't do as a result. Because they still have bills to pay, still need to eat, and crappy jobs with revolving doors and a steady turnover of temps often hire first and "weed out" later.
How to do better - Honesty it actually sounds as if your previous employer was ahead of the curve a bit - helping people get access to resources etc. So basically this - remember that people who have mental health issues are still people, remember that if you were unlucky you could easily be them, so get them help where you can, don't make the workplace part of the problem (see above), give decent healthcare coverage if you're in a country with a backwards healthcare system.
Conclusion
Most of the "how to do better" segments above are going to come with an attached cost - be it in higher wages, needing more staff etc. How much you can afford to actually do in this regard is going to be up to the business realities. There's way more hellish helpdesk-type environments out there then there are companies who intentionally set out to make it miserable - many are just driven that way because they're a cost sink. To take an absurd extreme you could staff your help desk with people who only worked ten hours a week of their choice, earned a million dollars, got free food, massages, therapy and puppies and they would probably be the happiest, most content helpdesk staff in the world. For about five minutes until the business went under. So it's about ensuring you meet the business need in a viable and sustainable way and ensuring that your staff are as happy and healthy as you can while doing that.