However, he routinely intentionally didn't fix bugs so that he could make a big show of getting up in the middle of the night to manually run processes, and would get praise and rewards from the manager.
I think you are looking at this wrong (or being too negative).
1) What you described might actually be a great strategy in a job where mobility is low. But in a career like IT, where it is so easy to move up or to switch jobs. it actually works poorly. If you (ie the coworker) are seen as the only one who can get the job done, you are likely not to be promoted (because no one else can replace you). You may get raises for a while, but after a point your job is just going to get outsourced when they figure that an outsourced company (or often an app in the cloud nowadays) is cheaper than your salary.
2) You and your coworker get 24 hours in a day. If that guy comes in to office, sits around and then goes into firefighting mode in the night, he is just spending more time per day on the job. You should ideally be happy that you are so much more efficient and get to spend time with family/hobbies etc. while the other "panic man" does not. You work 8 hours a day and get paid 8*wage per hour. At the very best case, the other guy works 10 hours and get paid 10*wage per hour. Often the other guy makes less than average hourly wage on the time he spends in the middle of the night, eventhough rationally night wages should be higher than day wages. Pay rarely scales linearly.
3) Most people who act like your coworker I describe (in my experience) are not actually cynically causing problems to be a "hero". They more often are just procrastinating or being lazy. I know this because I often do this on stuff when no one other than me is involved -- I know there is a problem, I know how long it will take to fix, but the solution is not elegant/too hairy/causes disruption in whatever other cool stuff I am doing etc. Or sometimes I just don't know how to fix something and I don't know who to ask. So I put it off and then something breaks and I have to fix it in a panic in the middle of the night. Never attribute to malice what can be adequately explained by stupidity.
Of course none of this applies if your job satisfaction depends on how are perceived relative to your coworker. Switching to an absolute measure for your personal goal ie ,I will aim to make 100K this year rather than aiming to be praised more than the coworker might help. (This sometimes works for me, not saying it might work for you) .Or try adding your hobbies or other uses of personal time into your career goals like "I will aim to be a better parent to my children while also ensuring that I earn enough money his college fund".