The question, "What is the purpose thereof?" cannot be asked about anything which is not the product of an agent; therefore we cannot ask what is the purpose of the existence of God.
Moses Maimonides, Aeterna Press (1948). “The Guide for the Perplexed”, p.440, Aeterna Press