Legalism, Religie