Probably felt he had achieved everything he needed to at Real Madrid but wasn't loved/adored by the club, squad, manager or fans as much as he deserves to.
No doubt Juventus will be paying him a fortune whereas Perez was probably trying to reduce it.
He's won trophies in England and Spain so I'm sure he'll love a few more trophies in Italy too. Don't be surprised to see him go to PSG next in a couple of years..
I don't think he needs the money but he'll enjoy being a high profile name in USA/China in the future.