There's a whole section of moral philosophy dedicated to whether it's morally right to subsequently go after the people who reported their neighbours. They knew they were sentencing their victims to imprisonment or death, but did so 'lawfully'. Ex post facto laws are an interesting moral conundrum.
Also laws sometimes don't actually reflect society as the process gets hijacked by companies, the billionaires controlling the media or vocal minorities (usually religious vocal minorities).