With that said, sometimes you want to make that commitment, because it's a socially good choice, rather than a financially good choice. Children need stability. Moving houses, neighborhoods, schools is not good for them. Good parents make sacrifices for their children, including staying in jobs where they might make a little less compared to Yet Another Move.
For most families who want to provide stability for their children, the choice is between purchasing a house, or a long-term rental of an apartment owned by a public housing authority that is bound by law or regulation to keep rent increases down and renters in-place, so long as they continue to pay their rent. In the US, most people do not have access to the latter, or the latter are only found in bad neighborhoods where the public housing authority was underfunded and mismanaged. That leaves purchasing real estate as the only option.