The good of a society is the sum of happiness of the individuals in that society.
The purpose of morality is promotion of the good of society.
A moral principle is ideal if and only if universal conformity to it would maximize the good of society.
Universal conformity to the principle of UTILITY ("Act always so as to maximize total net balance of pleasures and pains") would maximize the good of society