Most of Nigeria's history since independence in 1960 has been lived in the shadow of the military. As in many other former colonies, the military left behind by the colonial masters has become entrenched as a "deep state" within the state.
So the story of links between the military and the current terror crisis should not come as a surprise. A democratized body politic can only marginalize that deep state. Ergo, there are many ambitious men in the military who see it in their interest to undermine and destabilize the civilian government.
For its part, the government of Goodluck Jonathan, widely considered the most legitimately democratic government in the nation's history, has done itself no favours by continuing to govern for foreign bankers and oil conglomerates instead of for the interests of his people. His about face on the elimination of the fuel subsidies came only after the people mobilized in massive street protests.
What the military needs from Boko Haram is the creation of unrest, insecurity, and general destabilization. In short, Boko Haram is useful in creating a climate of fear that will engender wide-spread public support when the time is right for the next military coup.