"What if I buy a replacement home and spend more money – doesn’t that effect the taxation of the gain?"
That law went out in 1997. There is no more significance of a replacement residence. The new laws favor most taxpayers as it allows for multiple exclusions and it is not a deferment of gain but a permanent exclusion.