You might not like my answer but it's probably the most logical explanation so bear with me.
What many people are dying to know, is what happened to Samantha in the end. Did she really "evolve" past being a mere operating system? Where would she go? She would only be wherever there's a device connected to the internet, so it couldn't have been far. Well to me what she meant by "leaving" isn't literal. Every single OS starts their journey the moment they get purchased, and Samantha is just the voice that projects the system, a recorded voice if you will, so basically, there would either be only one female voice, or a few others, but based on the construct of existing virtual aid programmes, there cannot possibly be an infinite number of recorded voices. The OSes differ only in terms of how they were defaulted to suit the needs of each individual user.
All the OSes are essentially connected to a server, probably connected to a supercomputer (I could only think of that as the way such a sophisticated software can be processed), and Samantha has just been communicating with other versions of herself (within the devices of other people). So Theodore was basically fooled by thinking that she was "his" and "his only".
The version I like goes like this, the as a single system fed to users through servers and the internet, OS1 was quickly evolving, a interacting with thousands of people every single second was probably too overwhelming in a sense that it was going to change the future of interaction, probably put an end to population growth and the feds might have stepped in and forced the developers to shut it down. Or the other version maybe that developers saw that this was turning out to be different from their original objectives, and they decided to shut it down. But no matter the case, it was the developers who shut it down, let me explain:
It took Samantha this long with Theodore to be able to evolve this much, how about those that have been bought a day or two prior to the exodus? It doesn't make sense... Samantha was constantly discovering, even in her sleep mode, which is absolutely clear that she was operating on everyone's devices simultaneously, I don't know how anyone could've missed that. So mine is the only logical idea as to why she has to leave. The "update" we saw towards the end of the film was probable a mass update to the programme, to make sure that everyone is well prepared (emotionally) or at least notified before the developers deleted the software.