I have long been conflicted on this point: do Wizards need to pay to write spells they learn for leveling into their spellbook, or just when copying from a scroll or another spell book?
It seems that if you require paying with each level, you are nerfing your spellcaster until they can write down their new spells, but if you don't, then it's actually smarter for the players to avoid spells of their character's chosen arcane school, since the "savant" ability with each arcane school makes it faster and cheaper to add such spells to your spellbook.
Best Answer
No, you don't have to pay for spells you gain when leveling up
From the PHB, p. 114 sidebar:
As you see, the rules establish a clear difference between spells that add to your spellbook and those that you find and copy into it. If you take a look at the next part, you will know why.
As you see, the process of copying involves a lot of time, effort and materials which are dependent on you not yet knowing the spell and reproducing it yourself. For spells which you gain as you level, you skip all of this. The final sentence in the section makes it clear that once the spell is copied through this process, you can prepare it just like your other spells. This implies you do not go through this process for your other spells and that this is a different method of adding a spell to your spellbook.
Lastly, on the same page you are given these simple instructions on what happens when you gain new spells and when you do so.
And there is nothing more to it (aside from level restrictions on the spells).