Juve had to settle for the least profitable way of getting rid of Melo.
One can think of the 1.5 million loan fee as the amount Melo's price will depreciate in the next season. However.. No player, ever, playing in the Turkish League will have a price tag of about 13 million euros, especially if he is 29. Therefore Juve managers have miscalculated the amount that Melo's price will decrease.
What can happen next year:
1) Melo impresses, Gala wants to buy him. Melo won't be eager to return to Juve, as he has already chosen money over career (being in his late 20s, it makes sense). That gives Gala the edge in negotiations. The 13 million value has also fallen since the players performances became oblique: he does not play in Europa League, and noone watches the Turkish Super League. Parties agree for prices about 5-6 million.
2) Melo is not wanted at the end of season, returns to Juve only to look for a new club. Noone wants to buy him except Brazilian clubs, and he returns to his homeland for an even-lower transfer fee.