Wives who were "put away" were not abandoned. They were provided for materially, but sent back to their fathers house, and their children with them (if any).

This reformation described in Ezra chapter 10 was not commanded by God, but by Ezra. Flawed though it was, it represented an attempt to put things right that had gone wrong. It doesn't represent that God's solution to the problem was divorce.