When a luxury house is built and a family moves there, they have to move from their old home which is presumably worse. So will the slightly less wealthy family that buy their old home, and so fourth.
That said, preventing gentrification requires an active effort from policy makers.