To ask the question, "What is the purpose of God in that?" might be a valid and sincere question. But it also betrays the tiny limits of man.
Because it's likely that God, in His infinity, has thousands, or millions of "purposes" in every Providential act.
One may take a class in computer science for several different purposes. For example, to get credit for a degree; to prepare for a desired career; to impress their dad who thinks they're incapable of thinking digitally; to make more money in their uncle's company; to make their girlfriend happy; to run the Pyro graphics department some day; and just because they love computers.
Multiply that multi-purpose scenario by the factor of God-Head-ness, and to even think in terms of a single purpose is to not get it.
When the Hubble telescope took photos of what we thought was dark empty space between the galaxies that we had already photographed, vast new galaxies mysteriously appeared.
That's our powerful (and thankfully gracious) Lord who promises to work all things together for good to those who love Him, even when we can't fathom how.