Ridley Scott put a little Biblical parallel in there.
David represents humanity. And humanity represents the creator. David betrays his creators just as Lucifer betrayed god. They even show him as being creepily self-aware in the movies, thinking for himself, and having free will. By the end of the first movie, he is banished from human company just like Lucifer was banished from heaven.
The David in the second movie represents god’s second creation — humanity. He is loyal and devoted. He even loves his creator.
When he comes into contact with the old David, he is tempted into betrayal. He fights it of course, but eventually fails and goes down that same path and betrays his creator by playing with the same forbidden knowledge as his predecessor.
Alien Covenant was a remarkably dumb film by the way. This parallel is the only thing that kept me watching it. I found it interesting.
I could be wrong about it of course.