Right before Ramsay murdered him, Roose warned his son about the consequences of his actions.
Roose frequently tried to guide Ramsay down a less tortuous path of leadership. Though Ramsay's, uh, "talents" at manipulation were effective, Roose was able to see the potential backlash that came with flaying and torturing your subjects.
Minutes before Ramsay shoved a dagger into his side, Roose told his son: "If you acquire a reputation as a mad dog, you'll be treated as a mad dog — taken out back and slaughtered for pig feed."
Ramsay got the mad dog treatment all right. And now viewers can finally breathe a sigh of relief. Winterfell is out of Bolton hands forever.