Its roots are religious too, stemming from Puritanism brought to America's northeast, spreading westward to the burnt-over district [1] of western New York, and eventually the West Coast [2]. Puritan ideas like collective salvation and rooting out the bad thinkers showed up initially as literal witch hunts, and today as metaphorical witch hunts seeking to sniff out those who aren't true (enough) believers. It still takes the rough shape of Christian offshoot too, with a notion of original sin (think "White Guilt" or something related), has martyrs and saints, taboos, holidays and customs like any other religion.
[1] https://en.wikipedia.org/wiki/Burned-over_district [2] https://en.wikipedia.org/wiki/American_Nations