How do I maintain motivation in a completely awful grad program?
I think the first thing is to take a break - a week away from your department, in which you read no email and keep contact with no one there. From the text of the question, I understand you may be stressed and burnt out, so you do need the break. If you forget these breaks, burnout can become depression, which would complicate your life even further.

Other than that, try to hang out only with people who stress you the least, and if stressful people are in your office, work more from home, or switch offices. You didn't mention if you had an adviser, or not, but you said you had no support, so it could be an idea to go to an adviser with a less negative attitude, since you don't have a research assistantship to risk. 

Another option, is quitting the department for a better graduate school. I had a friend who did that for the same reasons you state, and the fact that he had passed the qualifying exam helped him get into the happier graduate program.

I also want to say that doing research isn't always a happy process. You may work for two years on a project and seem to get good results, but when you do your final check before publication, you realize you had an error in your work and, without it, your results are trivial and useless. That's just a part of life as a researcher that will always depress you.