the Amazing Spider-Man 2 and X-men Apocalypse turned about the same amount of profit when all was said and done.. at least i don't believe there was a huge difference. Amz 2 did actually make money and didn't do horrible at the box office... but it was a "critical" failure.. it was panned by critics.. and sony dropped the ball... (in all honesty it was kinda like Fox's X3, which at the time was also the highest grossing X-men film, but it was a bad film)
Sony didn't really "need" to have spidey join the MCU... but they wanted to as they figured it could revive the property as well as bring in more income.
It was the lowest grossing Spider-Man movie worldwide and domestic. Sony was not just pursuing an option to boost profits off of one of their properties. They had a whole slate centered around Spider-Man.
http://www.vulture.com/2015/02/sony-hack-wasnt-the-only-thing-to-hurt-pascal.html
"Sony's dramatic underperformance that year prompted billionaire Daniel Loeb who has used his Third Point hedge fund to become a major investor at the studio to repeatedly take Pascal and her co-chief Michael Lynton to task in the press, blasting the studio heads for their inability to produce new blockbuster franchises in a moviemaking climate that is now dominated by them."
http://variety.com/2014/film/news/a...lease-more-release-more-tentpoles-1201118909/
"In 2013, the studio had a feeble year at the box office, with disappointments including After Earth and White House Down, and posted an operating loss of $181 million for the fiscal second quarter on Oct. 31 according to the studios consolidated financial reports.
That said, Sony has done very well by the Spider-Man franchise. Its 2012 reboot, The Amazing Spider-Man, starring Andrew Garfield and Emma Stone, grossed $752 million worldwide, and the movie series is by far the studios most profitable. (Sony Pictures continues to share in the riches of the ongoing James Bond films, but that property is controlled by MGM, so the profit pool is far smaller.)
Meanwhile, SPE co-chairman Amy Pascal is spinning Spider-Mans web ever larger, taking a page from Marvel Entertainments superhero movie playbook. We are expanding the Spider-Man universe into The Sinister Six and Venom, so that we have Spider-Man movies every year, Pascal says."
Fox can jump off of Deadpool to get movies that can bring in healthy profits every couple of years and they have other franchises, too. Apes, Prometheus, Avatar, etc.