God is capable of getting it right the first time, but maybe He doesn't want to get it right the first time.
If He made everything right the first time, then everything would be perfect and the universe would be like a Heaven. And there wouldn't a lot of changes in the universe. And nobody would feel the need to pray to God or call Him if everything was perfect. So, maybe that's the reason why God allows imperfections to happen from time to time. And sometimes He even fixes them, if He wants to.
If He made everything right the first time, then everything would be perfect and the universe would be like a Heaven. And there wouldn't a lot of changes in the universe. And nobody would feel the need to pray to God or call Him if everything was perfect. So, maybe that's the reason why God allows imperfections to happen from time to time. And sometimes He even fixes them, if He wants to.