Well, Ganondorf was plotting something evil. Everybody was telling him that he needed the Master Sword in order to stop his plan, so naturally he wanted it. I don't see a reason not to want it. Although, because he drew the Master Sword, Ganondorf's plot was swung into action, Link didn't know this would happen. Had Link not drawn the Master Sword, Ganondorf's plot probably would have failed as he would have never made it to the Sacred Realm, however, Link thought the opposite of this (only with less details) and thought he was saving everyone by drawing the sword. Because he drew the sword, terror became the only emotion throughout Hyrule and everyone was living in peril. Ganondorf created his castle in the ruins of Hyrule Castle and Link needed to create the bridge their using the sage's power, so he gathered the medallions. Once he finally did reach Ganondorf, he defeated him. The Master Sword is the only way to do this.
So basically, Link drew the sword not knowing that he causes Hyrule's downfall, thinking he'll cause the opposite and stop Ganondorf. Because of Hyrule's downfall and the Master Sword the only way to defeat someone with so much power, he needed the sword. I have no idea why you asked this. He doesn't care if he keeps the Master Sword or not, that wasn't a gift for himself. It was the only sword that could defeat Ganondorf once he held a piece of the triforce.
Asking this is like saying "Why did Doc Brown make the time machine if he was just going to get stuck in 1855?" Well, he didn't know he was going to get stuck in 1855, and Link didn't know he was going to put back the Master Sword, although he didn't care enough, he'd rather live his childhood to its fullest.