ANSWER: According to one Biblical commentary, the phrase 'the book of life' comes from an ancient custom of keeping genealogical records (Nehemiah 7:5, 64, 12:22). Many questions can be asked about God such as why he does certain things in a certain way. It does seem, on the surface, that having such a volume would be redundant given our Creator is all-powerful. That said, with the Holy Spirit, we can comprehend (at least partly) some of the hidden or mysterious things God does (1Corinthians 2:7).
Surprisingly, the first place this volume occurs in the Bible is not in Revelation but in Apostle Paul's letter to the Philippians. Near the close of his letter, he exhorts two female helpers in the gospel, Euodia and Syntyche, to be of the same mind in what the Bible teaches. He then requests the fellowship in Philippi to help these women, whose names are written in this special book, in their efforts to spread the gospel (Philippians 4:1 - 3).
The reference found in Revelation 20, mentioned in your question, is the one most people are aware of. This mysterious volume is opened before God judges the vast majority of mankind.
12. And I (the apostle John) saw the dead, small and great, standing before God . . . and another book was opened, which is the book of life. And the dead were judged out of the things written . . . (Revelation 20:12, HBFV throughout)
Any human not found written within its pages would be cast into a fiery lake and perish forever (verse 15). Another place where this phrase occurs is a statement about the understanding those who are not converted will have at the end time (Revelation 17:8).
This mysterious volume appears again when John, in vision, sees the new heaven and earth God will create after judging all humans (Revelation 21). In this new creation, he also sees the New Jerusalem coming down to earth. Not everyone, however, will be allowed in the new city, but only those found in the Lamb's book (verse 27), which is the same one found elsewhere in Revelation. It's is the Lamb's because Jesus Christ, the true "lamb of God," is the Being in the Godhead who will judge all humans (John 5:22 - 23).
The conclusion we can draw from the above verses is that the volume found in Revelation 20 contains the names of those who will be granted eternal salvation. They are those who will receive access to the city of New Jerusalem God himself will personally create (see Revelation 22). The simple answer to why the Eternal has a book of life is because He wants one.