These are people in your industry, in your town. Some may know the person you hope will hire you next, or the one after that, or .... You and your former co-workers hope to have long careers at many different employers. Some will become employers themselves. This job will end sooner or later; your reptutation you'll keep with you.
For example, if you have a choice between doing a 5 minute patch or spending a couple hours refactoring it correctly, just do the 5 minute patch.
In two years (say) he will be interviewing somewhere, and sitting across from him will be the person that had to deal with the aftermath of that 5 minute patch. Or, it could be the person that had the pleasure of working with his refactored code. Which situation is better for him?
Not to mention that this situation is not the fault of the company or his coworkers. Why should they suffer?
I don't see a single thing that this attitude will accomplish other than "vengence", which in my book is something to avoid, as appealing as it may seem at dark moments.
I definitely notice when somebody makes a strong, professional finish. Indeed, it's a great way to understand somebody's character. Everybody's nice and helpful on their first day at work. It's how people behave when there's no immediate reward at stake that tells me what they'll be like in future tough situations.
Also, easiest way to get another job is for an ex-coworker to recommend you. Keep those bridges built.
You also show your evil manager and everyone else what a professional you are, even if he isn't.
I got fired once after 3 months at a company, without any warning or hints of my boss not being satisfied with my performance. I was completely devastated but decided to double down on my efforts for the period I had left. A week later my boss called me to his office and said that he had made a mistake firing me and offered me my job back. (I didn't accept)
I strongly disagree with this step. Ensure your performance is exceptional, flawless, and that everyone sees it. It's hard to do, hard to keep focus and not slip when everyone else is misbehaving, but it pays off:
1) It keeps your hands clean. Others won't know the inside story of why you were let go; if they see you slacking, they will doubt your character and work ethic and believe it's your fault. If they see exceptional performance they may give you the benefit of the doubt. You want them wondering, 'how could they fire him/her?'
2) It leaves a strong impression with everyone, possibly even your boss, of your work ethic and professionalism: 'Even knowing he/she would be fired, look what he/she did'. A crisis is a chance to show your quality.
3) It keeps your hands clean, which means you can sleep easily in the future. Don't do anything you will question later. Be proud of what you did and that you rose above your manager and the situation. Having been in similar situations, it made a great deal of difference in my self-respect and peace of mind down the road.