The Godhead of this earth,three separate personages, one in purpose... our Heavenly Father ( the actual Father of our Spiritual body) Jesus Christ, and the Holy Spirit... are each subject to Eternal Law, as are we all. Free agency is an integral part of Eternal Law.
We each existed as individual Intelligences of varying degrees of ability and power, previous to obtaining our Spiritual body... which then grew to maturity whilst housing our Intelligence, which also continued increasing in knowledge, according to our diligence and righteousness.
In order to further progress, and to receive an immortal resurrected body in which our Intelligence and Spiritual body will dwell for eternity, we chose to come to this earth on probation. Free agency to choose good or evil and then to reap the consequences, must be allowed for ALL, in order to enable judgement. The sufferings and evils of the world have been brought about by the choices mankind has made both in the past, and in our lifetime, and which future generations may inherit.
The suffering of the innocent is a consequence of the choices and actions of the causal perpetrators. It is the wicked who transgress Eternal Law NOT God.