You mean why is he leaving now despite having the opportunity to do so all along? Could be lots of reasons -
1. Loss of a No. 1 status. Even after Rossi returned (to help sell bikes among other things) Lorenzo was still top dog in the Yamaha paddock. Not anymore and that's not an easy thing to let go off after you've had it (as Rossi can probably testify to).
2. Perceived lack of loyalty from Yamaha. There's a fair argument to be made that the Yamaha management has treated him as an employee rather than a member of a family. After all, it was Rossi who jumped ship from Honda to Yamaha then to Ducati and then back to Yamaha. In contrast, Lorenzo has been a Yamaha man throughout. It would be natural to resent Rossi being treated with the same familiarity.
3. A powerful position at Ducati. Not just a lead role in development but influence in management decisions and the like. (Its widely rumored that it was ultimately Lorenzo's preference that caused Ducati to go with Dovizioso over Iannone.)
4. Spec tires, spec electronics. Illustrates Dorna's efforts to make the sport more competitive, improving the prospects of other teams. Prospects for a non-Honda/Yamaha team are brighter than ever before.
5. Money. He's not going to retire like most people with a pension at 62. Sure he's making millions already but whatever he makes will need to last him the rest of his life. He's got a (relatively) narrow window in which he can continue to remain competitive at the highest level. And Ducati are believed to have offered him a staggering sum. (More than what Rossi is making at Yamaha I believe, though we're in the realm of base rumor here.)
Well.. yes. But keep in the mind, its not just the riders who're affected by these decisions. They're competing as a team and the crew's role is every bit as important as the rider's. Getting a rider DQed also means there's an entire section of hardworking people - engineers, mechanics, admin staff, Uccios - that are reduced to watching the race from the sidelines.
Thing is, it always counted. A rider's performance in MotoGP is the sum of his ability in a diverse set of conditions (both technical and environmental). Consistency matters just as much as pace. And in the final scheme of things Rossi was within spitting distance of Lorenzo in 2015, and comfortably ahead in 2014.
Purely on riding ability, setting aside other factors, Yamaha cannot really be faulted for treating two at par.
Sure Vinales was a longer shot early in the season while Lorenzo is a proven race winner (though given how hard Suzuki fought to retain him, Vinales' potential was well known.) But this just goes to support the argument that far from forcing him out, Yamaha did try to retain Lorenzo; of course it was not possible for them to be as generous as Ducati.