I'm looking at Spugnoir ID#14038. He has duplicate spells like Burning Hands and Read Magic. Why is this the case?
Those are the complete list of spells that an NPC wizard will have available in memory for their AI to use if you attack them and they enter combat. So Spuggy would have 2 copies of Burning Hands to cast if attacked, assuming his strategy is scripted to actually use them. In the case of Read Magic, two copies aren't needed since he wouldn't cast it during combat, so I'm not sure why 2 are in there. Take a look at 14233 (Senshock) for a better example. He has two copies of Magic Missile, Tasha's, Deep Slumber, and Lightning Bolt. So if his script calls to cast any of those, he'll be able to cast each one twice before reverting to another spell still in memory. Note though, that this list is not used to put spells in the wizard's memory if recruited or dominated. The player has to do that manually after recruitment, as you probably know. Only the spells listed in a wizard's proto will be in his spellbook if you recruit or dominate him (plus all cantrips). In the case of sorcerers or bards, these will be the spells they "know". Since that add all cantrips to the spellbook too, Read Magic isn't really needed to be on his list at all. But it's a harmless oversight that causes no problems. If it were a higher level wizard, like the case of Senshock, you wouldn't want to waste those slots with cantrips since there are only 20 total slots available in his proto.
They are used for both purposes. If he is not in the group, they are the spells he has memorized and available to the AI for pre-buffing or during combat. Once recruited or dominated, they become the spells in his spell book (for a wizard), or the spells "known" in the case of a sorcerer or bard.