This sounds like someone pretending to be solemn or serious, when it is only an act. They don't really feel serious or pious. Also if they are mocking, they might be making fun or making light of something serious or solemn. They may be laughing or joking about something they should be serious about.