I'm not sure if this was really the Egyptian military's plan all along, or if they just did what they could to foster discontent over Morsi and then took advantage of it when frustration boiled over. But this seems to be a really plausible reading of what happened.