Veil-of-ignorance reasoning favors the greater good