Why would they leave a secure job? Some obviously do, but it can be hard for some actors to get work after they are so closely associated with one character. It's a precarious profession anyway, so I guess if they're happy where they are, why not stay?
I think that this is probably the correct answer.
Let's say Adam Woodyatt (Ian Beale) left Eastenders, how likely is it he would get another TV role?
You often find that actors taht have become so established in a role or a type of role they are either stuck doing it forever or they stop and just become famous and a celeb.
I think a good case in point is Barbara Windsor. She said in a few interviews years ago she was close to quitting acting and becoming an agent. She was still playing the busty blonde kind of roles she had been doing in the Carry On films for the last 10 years on stage. She was fed up with it and she was too old for it. She was starting look a bit sad and desperate. She had set a date to call it a day and she got two phone calls. One was to do a single episode of One Foot in the Grave where she got to play a woman her own age that dressed properly and wasn't all clevage and the other was Eastenders. That role totally changed the country's perception of her to the point people would start calling out to her "Peggy" rather than "Barbara."
Unlike film and theatre where you can escape a character because you are either seen once (theatre) or a person has to make a point of getting the DVD to see the film and thus that character. When it comes to TV, that character can become so associated with you that even when you stop doing it people see you as that character because of the repeats.
The last episode of Only Fools and Horses was 10 years ago this year(Christmas Day 2003) and Roger Lloyd Pack is still always thought of as Trigger despite being in The Vicar of Dibley as well as Doctor Who, Survivors, The Old Guys, The Borgias and other things on TV. The neverending OFAH means he will never escape Trigger.
If you are in a soap where you are seen weekly month after month and year after year it's even worse, so it's understandable they stay as long as they can once they get past a certain point or number of years