There really isn't a choice. Nobody pays more than they have to, to secure a house purchase. If the price paid is 1M, that's because that's the price the seller wanted. They'd have demanded that price whoever bought it. And if the price is 1M in whatever town we're gentrifying, then a similar house in SF would be considerably more (and thus not affordable).
I get the frustration with gentrification. But what's the alternative? Everyone must live and die in the town/city in which they were born? What's more, if nobody is coming to your town to live/work, it just slowly declines as the population ages out of work. Visit some of the old mining towns in the UK to see what that's like.
At least if you have a steady stream of incoming "rich people", then the entrepreneurial folk in the town have a chance at extracting some of that wealth.