Because the "mortgage payoff" plays absolutely no part in determining your gain or loss on the sale of the home. The gain (or loss) is a very simple calculation:
Selling price after deducting selling costs, (commissions, etc.) minus your cost basis.
The equation is unchanged and not affected by how you happened to finance the home purchase. The money that went to the lender as part of the sale settles your liability to the lender, it doesn't affect the calculation of the profit or loss.