I believe Rivera's contract was up and they did not resign him. Lovie had gained alot of power from going to the SB and decided to flex his muscles. If I remember this correctly, Lovie originally wanted Marinelli as his D Coordinator but Tampa would not let him go. He then wanted Babich but Angelo said he wanted someone with more experience so they settled on Rivera. After the SB, Lovie decided to promote Babich and let Lovie go. Ultimately, this was a huge mistake as we can see Lovie needed someone
with a differing view running the defense. Rivera, as you said, was able to take Lovie's system and tweek it successfully. Babich hasn't a clue.
Peace