Sources of copied spellbooks can be sold at your leisure.
Only wizards have the class feature to copy spells into their spellbooks. Your Warlock friend can't copy spells into spellbooks and uses an altogether different form of spellcasting, that is Pact Magic, granted by their otherworldly patron which is detailed in the PHB (107).
How it works for wizards:
A wizard gains access to 9th-level spell slots at 17th wizard-class-level (PHB 113). If he is not at least a 17th-level wizard, he cannot copy the spell into his spellbook because his level doesn't grant him access to a 9th-level spell slot.
Your Spellbook (PHB 114)
Copying a Spell into the Book. When you find a wizard spell of 1st level or higher, you can add it to your spellbook if it is of a
level for which you have spell slots and if you can spare the time to
decipher and copy it.
Copying a spell into your spellbook involves reproducing the basic
form of the spell, then deciphering the unique system of notation used
by the wizard who wrote it. You must practice the spell until you
understand the sounds or gestures required, then transcribe it into
your spellbook using your own notation.
Replacing the Book. You can copy a spell from your own spellbook into another book—for example, if you want to make a backup copy of
your spellbook. This is just like copying a new spell into your
spellbook, but faster and easier, since you understand your own
notation and already know how to cast the spell. If you lose your spellbook, you can use the same procedure
to transcribe the spells that you have prepared into a new
Copying a spell into your spellbook reproduces the spell and actively transcribes it in your spellbook into your style of notations which is unique to you. Your copies are all based on your unique system, and that unique system is required for you to prepare spells from your spellbook (PHB 114).
You can make these back-up copies and sell them or their source at your leisure. You do not require the source after you copied them. If you lose your spellbook, you can even transcribe your spells into a new book as long as you have them currently prepared.
Also read: What are the requirements for a wizard to successfully copy a spell from a scroll into their spellbook?
Also read: How can a warlock learn from a spellbook?