How can a perfect being have “passions” or emotional responses to things? The Bible doesn’t say. It just talks about God’s response to things in emotional language and then claims that God is perfect in the sense that he is completely properly formed in his being and person.
For those interested in trying to understand this better, I recommend this article by Paul Helm here.
The Doctrine is called “Diving Constancy” or more commonly “Divine Impassibility”.