A wizard needs a written spell to let other wizards learn it.
Adding Spells to a Wizard’s Spellbook:
A wizard can also add a spell to his book whenever he encounters one on a magic scroll or in another wizard's spellbook.
So, if the wizard wants to teach someone this spell he needs it written.
Sure, he can write it down from memory:
Replacing and Copying Spellbooks
A wizard can use the procedure for learning a spell to reconstruct a lost spellbook. If he already has a particular spell prepared, he can write it directly into a new book at the same cost required to write a spell into a spellbook. The process wipes the prepared spell from his mind, just as casting it would. If he does not have the spell prepared, he can prepare it from a borrowed spellbook and then write it into a new book.
But it costs money, so having it already written saves your gold.
Why would he want to teach anyone his spells? That largely depends on the campaign. Often NPC wizards would agree to exchange spells, for example.