Because the cost of selling the property is added to the basis. This would be the same as separately subtracting the expense from the net gain from the sale.
On form 8949 (which must be completed before Schedule D for the sale of a home), on Part II, there is no line on which to report cost of selling, so the cost is rolled into the basis to get the correct result.
Then the results on the 8949 are transferred to Schedule D.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"