Russell E. Saltzman ponders the question of why God creates :

“What was God doing before creation?” is another stumper but here there are some answers—of a sort. Augustine flat declared it was impossible even to ask inasmuch as there never will be an answer, so there. I like Luther’s better. He ventured the opinion God was off cutting switches so he could flail us when we did ask. (Naturally, God would have had to first create the branches from which the switches were cut, indicating there was hardly a time when God was not creating, but maybe that’s something Luther meant to put across.)