The idea that if he's in bad movies he will be damaged goods isn't necessarily true though. People still love Hugh Jackman as Wolverine even though he's been in a lot of terrible X-Men movies. Christopher Reeve was also in some truly terrible Superman movies but he's still considered to be the definitive Superman by a lot of people.
It just seems strange to me that Marvel, the company that has gone so far as to fire and/or part ways with directors who didn't follow their vision, would completely and totally give up their quality control power in a deal they didn't have to make.
Make no mistake, ASM2 was a disappointment to Sony. Marvel went into these negotiations with the advantage, which is saying something considering it's Sony that owns the character.
If Marvel were really negotiating from a position of advantage, do you really think the end result would have been sharing the character instead of Marvel owning him outright? While Sony was at a disadvantage in that they needed to reinvigorate Spider-Man to make sure they had a summer tentpole, Marvel's disadvantage is that post-Infinity War, they're going to need new characters to lead the MCU or the movies are going to start getting really, really, really expensive as everyone's old contracts start running out (see: RDJ making somewhere around $50 million to do Civil War, IIRC).
They don't necessarily need that character to be Spider-Man though.
Iron Man was nothing before they made that film. Nobody knew who he was. Now he's a billion dollar star.
I think the only reason Marvel didn't buy it outright is because Sony probably never wanted that as a possibility. They wanted someone to fix their Spider-Man films, and Marvel will do that with Homecoming.
And Disney will make bank on merchandising because they own 100% of that. The deal benefits both sides.
That's no different from before though. Disney was always making that, whether they were making the Spider-Man movies or not.