To program a quantum annealer, one must construct objective functions whose minima encode hard constraints imposed by the underlying problem. For such "penalty models," one desires the additional property that the gap in the objective value between such minima and states that fail the constraints is maximized amongst the allowable objective functions. In this short note, we prove the standard penalty model for the constraint that a bitstring has given Hamming weight is optimal with respect to objective value gap.