It is often misquoted. It is more about pride and courage, not evil.
The mind is its own place and in it self
Can make a Heav’n of Hell, a Hell of Heav'n.
What matter where, if I be still the same,
And what should I be, all but less than hee
Whom Thunder hath made greater? Here at least
We shall be free; th’ Almighty hath not built
Here for his envy, will not drive us hence:
Here we may reign secure, and in my choyce
To reign is worth ambition though in Hell:
Better to reign in Hell, then serve in Heav'n.
It is also a fantastic pep talk.
Interpreting the line of Milton as a label of evil might be overthinking it just a bit. In the early scenes of the film, David is simply obeying his programming. He serves a purpose not his own.
I have my characters recite Milton often and it is never intended as a signal to the reader that they are evil. It is intended as a sign they are well-read. I am not about to delete that - if someone decides that they must be tagged evil because they know Paradise Lost, so be it.
Using small sections of other texts is intertextuality. Turning characters into symbols of other characters certainly is done - references to Job or such - but a character should stand on his own without relying on the symbolic shadow in which he stands.