Problem is that the very own game AI is set to fight wars to the bitter end. Civ programmers never expected (let's be honest, who could have expected this) that players would want to keep a Civilization alive even if it's annoying and they have the power to crush them within a couple of turns... So they made AIs fight to the last, to motivate players to devise strategies to beat the opposition.
I normally find myself using World Builder just to make Portugal sign peace with its attacker. At extreme cases, I wipe out entire stacks to ensure that no one wipes the other out. A hidden modifier, that forces Spain and Portugal to be friendly, yet that forces both to trains Privateers; at least until 19th Century would be nice....