Negotiations with Brady fell apart and they didn't have a good backup plan.
I think they were planning to go with Stidham but were surprised Newton was still available. I suspect they knew the ceiling of players like Dalton, Foles, and Winston who would never be good enough to get them a Superbowl. They were able to get Newton at a discount price. They figured at best we get the 2015 MVP and at worst we play Stidham while wasting a million on Netwon. Stidham getting hurt in training camp gave the upper hand to Newton. If Newton has another few bad games they'll turn to Stidham to see what he has before making a move for a quarterback next year via free agency or the draft.