A metaphorical police force imagined to prevent others from having fun.
party pooper
noun
One who dampens fun; especially, one who declines to participate in or enjoy a party or some other group activity; one who does not agree with the opinions of a group.
How often have the words fun police and party pooper occurred in a corpus of books? (source: Google Ngram Viewer )