'Bad faith' (and it's corollary, 'good faith') and the closely associated concept of 'malice' are used in a number of unrelated legal contexts. Generally though it is a heightened standard of liability, or particularly egregious behaviour or intent. For example, 'malice' is used to void the defamation defence of 'fair comment'. 'Bad faith' is used heavily by government in limiting the liability of various government bodies by immunizing their liability for acts done in 'good faith' (or not, when they are acting in 'bad faith') [eg. ODSPA, s.58(1)]:
No personal liability
58 (1) No action or other proceeding in damages shall be instituted against the Ministry, the Director or a delivery agent, an officer, employee of any of them or anyone acting under their authority for any act done in good faith in the execution or intended execution of a duty or authority under this Act or for any alleged neglect or default in the execution in good faith of any duty or authority under this Act.