Why heirs of a retiring/deceased partner are entitled to a share of goodwill of the firm?

The retiring partner / heirs of deceased partner are entitled to his share of goodwill because the goodwill earned by the firm is the result of the efforts of all the existing partners in the past. As they will not be sharing future profits, it will be fair to compensate them for the same.