I'm running a high-level campaign where two players brought to the table two very powerful and costly intelligent items, which they filled with every kind of spell they could need. They also gave them a special purpose to be able to get the best stuff around. My question is, by RAW, does the special purpose have to be chosen among the ones provided in the column (for example: defeat this kind of creatures) or can it be chosen by the player? Because I think that the purpose of "keeping Player X alive" is a bit too cheesy and almost cheaty.
If you are the GM, its your job to allow or disallow any custom created magic item. You could simply tell them right away that they have to pick a purpose other than that, or that they actually have to roll a purpose on that random table, you could ban the item and tell them to come with something else closer to what has been officially published instead, or outright ban custom magic item creation.
The Magic Item Gold Piece Values table is a tool for GM's and authors to design magic items, players will always try to obtain the cheapest magic item possible using that table, sometimes even using wrong calculations and/or not considering a similar existing magic item. Like using a Can only be wielded by Half-elves restriction to reduce the price by 30%, creating infinite re-usable magic items (potions of infinite cure light wounds, or arrows of true strike), or even attempt to break the action economy assuming that the item's abilities should be used automatically instead of requiring a Standard Action.
What I would do, personally, is simply to change who the weapon must protect. The player would have to designate a different person as the protectee. Not only that, but a weapon that has an existing purpose of protecting someone will attempt, at all costs, to protect that person in combat or outside of combat. At the cost of ignoring the wielder commands to do something else (like attack an enemy), which then would require a Will check versus the weapon's Ego, or casting spells when they are not needed, so the protectee is safe from surprise attacks and assassins. The higher the item's Ego, the more it will try to force their personality into the wielder.
Remember, intelligent items are still NPC's under your control:
Magic items sometimes have intelligence of their own. Magically imbued with sentience, these items think and feel the same way characters do and should be treated as NPCs.
As the GM, if you think an item is too strong, you can change it. Of course, you still want to be fair with your players, but that doesn't mean you have to allow in the game everything they come up with.
It's not just the ones on the list
Table: Intelligent Item Purpose has a number of sample purposes that a magic item might possess
Which implies that there are more options than just that. However any options beyond those listed would certainly need to be subject to DM approval-- there's no indication that all purposes are valid. Furthermore, some ways of making items can only make those from the list, such as the impart mind spell.
It should be noted that some people interpret 'choose one' to mean 'choose any purpose', but 'choose one from this list' is an equally valid reading, and obviously preferable given your goals.
The purpose given is pretty reasonable
'Defend my servants and interests' is a valid purpose, as long as you pretend to divinity, as is 'defend blue-haired halfling multiclass druid/wizard theurges' . 'Keep John Alive' seems reasonably in the same vein, except it's likely to go horribly wrong, I, Robot (the movie) style.
Intelligent items aren't custom items, and the primary reason for getting them is the incredible flexibility they provide, ostensibly without the need for GM oversight. That said, they are extremely powerful, and can easily disrupt a campaign where other players are making poor character design choices. You said you are trying to run an epic campaign, so I doubt at-will Limited Wish, Greater Glyph of Warding, and Resurrection are the biggest problems you are facing, but it will still be one of the many problems if someone tries to make, say, a monk with a forward-ported Vow of Poverty.