Sony was in an impossible position though. There is no way they reboot in 2012 if they indefinitely own the rights. They clearly don't, hence a 5 year turn around.
If you made SM4, you would need to spend way more than 220 million. The cast alone would drive the budget north of 275 million, considering SM3's price tag even had they scaled it down. More so, the movie was shaping up to be a disaster to my knowledge with the turmoil between Raimi's and the producers' vision for the franchise.
If you recast everybody for SM4, it would have felt like a completely different franchise. I realize audiences weren't happy with SM3 and the actors were probably passed their prime Spidey years (that's more of a fact), but recasting is definitely a killer when you replace basically the entire core cast. Tobey and Dunst were willing to come back though as long as Raimi was involved.
With that said, I probably would have recasted. But I would have tried to bring back some supporting actors and work them in to give it the same feel. It would not have been easy though because they forwarded the story too fast in SM3 by killing Brock and Harry along with a wedding proposal. It was another X-3 situation.
Sony did not have an easy decision by any stretch. You can't go back in hindsight and say they shouldn't have rebooted. Yeah they knew the risks. They made a tough choice to let go of Raimi and start anew. Maybe it will still pay off for them down the line.