In fact, the showrunners first thought about putting Sansa and Ramsay together back when they were writing season 2. We really wanted Sansa to play a major part this season, Benioff said. If we were going to stay absolutely faithful to the book, it was going to be very hard to do that. There was as subplot we loved from the books, but it used a character thats not in the show.
Writer-producer Bryan Cogman had some insight, as well. The seeds were planted early on in our minds, Cogman said. In the books, Sansa has very few chapters in the Vale once shes up there. That was not going to be an option for one of our lead characters. While this is a very bold departure, [we liked] the power of bringing a Stark back to Winterfell and having her reunite with Theon under these circumstances.