Said the Intellect - What we can grasp in this matter is, that HaShem may his name be blessed is certainly the perfection of good. And indeed it is the rule of good to do good, and this is what He may his name be blessed wanted - to create creations in order the he could do good for them, for if there is no one to receive the good then there is no giving of good.
Goodness Seeks to Share Itself with All Creation
Da'at Tevunot 18:1